Record Class RegexPattern.Alternation
java.lang.Object
java.lang.Record
com.google.common.labs.regex.RegexPattern.Alternation
- All Implemented Interfaces:
RegexPattern
- Enclosing interface:
RegexPattern
public static record RegexPattern.Alternation(List<RegexPattern> alternatives)
extends Record
implements RegexPattern
Represents a choice between multiple alternative regex patterns.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.common.labs.regex.RegexPattern
RegexPattern.Alternation, RegexPattern.Anchor, RegexPattern.AtLeast, RegexPattern.AtMost, RegexPattern.Backreference, RegexPattern.CharacterProperty, RegexPattern.CharacterSet, RegexPattern.CharRange, RegexPattern.CharSetElement, RegexPattern.Group, RegexPattern.Limited, RegexPattern.Literal, RegexPattern.LiteralChar, RegexPattern.Lookaround, RegexPattern.Metadata, RegexPattern.ModifierFlag, RegexPattern.PosixCharClass, RegexPattern.PredefinedCharClass, RegexPattern.Quantified, RegexPattern.Quantifier, RegexPattern.Sequence, RegexPattern.UnicodeProperty -
Constructor Summary
ConstructorsConstructorDescriptionAlternation(List<RegexPattern> alternatives) Creates an instance of aAlternationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thealternativesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.metadata()Returns this pattern's metadata that may be useful for static analysis.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
followedBy, notFollowedBy, notPrecededBy, precededBy
-
Constructor Details
-
Alternation
Creates an instance of aAlternationrecord class.- Parameters:
alternatives- the value for thealternativesrecord component
-
-
Method Details
-
metadata
Description copied from interface:RegexPatternReturns this pattern's metadata that may be useful for static analysis.- Specified by:
metadatain interfaceRegexPattern
-
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 withObjects::equals(Object,Object). -
alternatives
Returns the value of thealternativesrecord component.- Returns:
- the value of the
alternativesrecord component
-