Record Class RegexPattern.AtMost
java.lang.Object
java.lang.Record
com.google.common.labs.regex.RegexPattern.AtMost
- All Implemented Interfaces:
RegexPattern.Quantifier
,Function<RegexPattern, RegexPattern>
,UnaryOperator<RegexPattern>
- Enclosing interface:
RegexPattern
public static record RegexPattern.AtMost(int max, boolean isReluctant, boolean isPossessive)
extends Record
implements RegexPattern.Quantifier
Represents a quantifier with a maximum bound and a minimum of 0, like
{0,max}
or
?
.-
Constructor Summary
ConstructorsConstructorDescriptionAtMost
(int max, boolean isReluctant, boolean isPossessive) Creates an instance of aAtMost
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
Returns the value of theisPossessive
record component.boolean
Returns the value of theisReluctant
record component.int
max()
Returns the value of themax
record component.toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.google.common.labs.regex.RegexPattern.Quantifier
apply
-
Constructor Details
-
AtMost
public AtMost(int max, boolean isReluctant, boolean isPossessive) Creates an instance of aAtMost
record class.- Parameters:
max
- the value for themax
record componentisReluctant
- the value for theisReluctant
record componentisPossessive
- the value for theisPossessive
record component
-
-
Method Details
-
reluctant
- Specified by:
reluctant
in interfaceRegexPattern.Quantifier
-
possessive
- Specified by:
possessive
in interfaceRegexPattern.Quantifier
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with thecompare
method from their corresponding wrapper classes. -
max
public int max()Returns the value of themax
record component.- Returns:
- the value of the
max
record component
-
isReluctant
public boolean isReluctant()Returns the value of theisReluctant
record component.- Specified by:
isReluctant
in interfaceRegexPattern.Quantifier
- Returns:
- the value of the
isReluctant
record component
-
isPossessive
public boolean isPossessive()Returns the value of theisPossessive
record component.- Specified by:
isPossessive
in interfaceRegexPattern.Quantifier
- Returns:
- the value of the
isPossessive
record component
-