Package org.passay.rule
Enum MatchBehavior
- All Implemented Interfaces:
Serializable,Comparable<MatchBehavior>
Enum that defines how string matching should occur.
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe description of the match behavior.private final BiFunction<UnicodeString,UnicodeString, Boolean> The matcher function. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateMatchBehavior(String desc, BiFunction<UnicodeString, UnicodeString, Boolean> matcherFunction) Constructs a MatchBehavior constant. -
Method Summary
Modifier and TypeMethodDescriptionbooleanmatch(UnicodeString text, int cp) Returns whether text matches the supplied string for this match type.booleanmatch(UnicodeString text, CharSequence s) Returns whether text matches the supplied string for this match type.booleanmatch(UnicodeString text, UnicodeString s) Returns whether text matches the supplied string for this match type.toString()Returns the name of this match behavior in upper case snake casing.static MatchBehaviorReturns the enum constant of this type with the specified name.static MatchBehavior[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
StartsWith
-
EndsWith
-
Contains
-
-
Field Details
-
description
The description of the match behavior. -
matcher
The matcher function.
-
-
Constructor Details
-
MatchBehavior
Constructs a MatchBehavior constant.- Parameters:
desc- the behavior descriptionmatcherFunction- the matcher function
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
upperSnakeName
Returns the name of this match behavior in upper case snake casing.- Returns:
- upper case snake name
-
match
Returns whether text matches the supplied string for this match type.- Parameters:
text- to searchcp- code point to find in text- Returns:
- whether text matches the supplied string for this match type
-
match
Returns whether text matches the supplied string for this match type.- Parameters:
text- to searchs- to find in text- Returns:
- whether text matches the supplied string for this match type
-
match
Returns whether text matches the supplied string for this match type.- Parameters:
text- to searchs- to find in text- Returns:
- whether text matches the supplied string for this match type
-
toString
- Overrides:
toStringin classEnum<MatchBehavior>
-