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 aAtMostrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisPossessiverecord component.booleanReturns the value of theisReluctantrecord component.intmax()Returns the value of themaxrecord component.toString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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 aAtMostrecord class.- Parameters:
max- the value for themaxrecord componentisReluctant- the value for theisReluctantrecord componentisPossessive- the value for theisPossessiverecord component
-
-
Method Details
-
reluctant
- Specified by:
reluctantin interfaceRegexPattern.Quantifier
-
possessive
- Specified by:
possessivein 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 thecomparemethod from their corresponding wrapper classes. -
max
public int max()Returns the value of themaxrecord component.- Returns:
- the value of the
maxrecord component
-
isReluctant
public boolean isReluctant()Returns the value of theisReluctantrecord component.- Specified by:
isReluctantin interfaceRegexPattern.Quantifier- Returns:
- the value of the
isReluctantrecord component
-
isPossessive
public boolean isPossessive()Returns the value of theisPossessiverecord component.- Specified by:
isPossessivein interfaceRegexPattern.Quantifier- Returns:
- the value of the
isPossessiverecord component
-