/** * Matches a {@link NamedElement} for its exact name. * * @param name The expected name. * @param <T> The type of the matched object. * @return An element matcher for a named element's exact name. */ public static <T extends NamedElement> ElementMatcher.Junction<T> named(String name) { return new NameMatcher<T>(new StringMatcher(name, StringMatcher.Mode.EQUALS_FULLY)); }
/** * Matches a {@link NamedElement} for its name's prefix. * * @param prefix The expected name's prefix. * @param <T> The type of the matched object. * @return An element matcher for a named element's name's prefix. */ public static <T extends NamedElement> ElementMatcher.Junction<T> nameStartsWith(String prefix) { return new NameMatcher<T>(new StringMatcher(prefix, StringMatcher.Mode.STARTS_WITH)); }
/** * Matches a {@link NamedElement} for its name's suffix. * * @param suffix The expected name's suffix. * @param <T> The type of the matched object. * @return An element matcher for a named element's name's suffix. */ public static <T extends NamedElement> ElementMatcher.Junction<T> nameEndsWith(String suffix) { return new NameMatcher<T>(new StringMatcher(suffix, StringMatcher.Mode.ENDS_WITH)); }
/** * Matches a {@link NamedElement} for an infix of its name. * * @param infix The expected infix of the name. * @param <T> The type of the matched object. * @return An element matcher for a named element's name's infix. */ public static <T extends NamedElement> ElementMatcher.Junction<T> nameContains(String infix) { return new NameMatcher<T>(new StringMatcher(infix, StringMatcher.Mode.CONTAINS)); }
/** * Matches a {@link NamedElement} for an infix of its name. The name's * capitalization is ignored. * * @param infix The expected infix of the name. * @param <T> The type of the matched object. * @return An element matcher for a named element's name's infix. */ public static <T extends NamedElement> ElementMatcher.Junction<T> nameContainsIgnoreCase(String infix) { return new NameMatcher<T>(new StringMatcher(infix, StringMatcher.Mode.CONTAINS_IGNORE_CASE)); }
/** * Matches a {@link NamedElement} for its name's prefix. The name's * capitalization is ignored. * * @param prefix The expected name's prefix. * @param <T> The type of the matched object. * @return An element matcher for a named element's name's prefix. */ public static <T extends NamedElement> ElementMatcher.Junction<T> nameStartsWithIgnoreCase(String prefix) { return new NameMatcher<T>(new StringMatcher(prefix, StringMatcher.Mode.STARTS_WITH_IGNORE_CASE)); }
/** * Matches a {@link NamedElement} for its name's suffix. The name's * capitalization is ignored. * * @param suffix The expected name's suffix. * @param <T> The type of the matched object. * @return An element matcher for a named element's name's suffix. */ public static <T extends NamedElement> ElementMatcher.Junction<T> nameEndsWithIgnoreCase(String suffix) { return new NameMatcher<T>(new StringMatcher(suffix, StringMatcher.Mode.ENDS_WITH_IGNORE_CASE)); }
/** * Matches a {@link NamedElement} for its name. The name's * capitalization is ignored. * * @param name The expected name. * @param <T> The type of the matched object. * @return An element matcher for a named element's name. */ public static <T extends NamedElement> ElementMatcher.Junction<T> namedIgnoreCase(String name) { return new NameMatcher<T>(new StringMatcher(name, StringMatcher.Mode.EQUALS_FULLY_IGNORE_CASE)); }
/** * Matches a {@link NamedElement} name against a regular expression. * * @param regex The regular expression to match the name against. * @param <T> The type of the matched object. * @return An element matcher for a named element's name's against the given regular expression. */ public static <T extends NamedElement> ElementMatcher.Junction<T> nameMatches(String regex) { return new NameMatcher<T>(new StringMatcher(regex, StringMatcher.Mode.MATCHES)); }