public final class ImmutableUncompiledPattern extends Object implements UncompiledPattern
UncompiledPattern.
Use the builder to create immutable instances:
ImmutableUncompiledPattern.builder().
Use the static factory method to create immutable instances:
ImmutableUncompiledPattern.of().
| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableUncompiledPattern.Builder
Builds instances of type
ImmutableUncompiledPattern. |
| Modifier and Type | Method and Description |
|---|---|
static ImmutableUncompiledPattern.Builder |
builder()
Creates a builder for
ImmutableUncompiledPattern. |
static ImmutableUncompiledPattern |
copyOf(UncompiledPattern instance)
Creates an immutable copy of a
UncompiledPattern value. |
boolean |
equals(Object another)
This instance is equal to all instances of
ImmutableUncompiledPattern that have equal attribute values. |
int |
flags() |
int |
hashCode()
Computes a hash code from attributes:
regex, flags. |
static ImmutableUncompiledPattern |
of(String regex,
int flags)
Construct a new immutable
UncompiledPattern instance. |
String |
regex() |
String |
toString()
Prints the immutable value
UncompiledPattern with attribute values. |
ImmutableUncompiledPattern |
withFlags(int value)
Copy the current immutable object by setting a value for the
flags attribute. |
ImmutableUncompiledPattern |
withRegex(String value)
Copy the current immutable object by setting a value for the
regex attribute. |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcompile, ofpublic String regex()
regex in interface UncompiledPatternregex attributepublic int flags()
flags in interface UncompiledPatternflags attributepublic final ImmutableUncompiledPattern withRegex(String value)
regex attribute.
An equals check used to prevent copying of the same value by returning this.value - A new value for regexthis objectpublic final ImmutableUncompiledPattern withFlags(int value)
flags attribute.
A value equality check is used to prevent copying of the same value by returning this.value - A new value for flagsthis objectpublic boolean equals(Object another)
ImmutableUncompiledPattern that have equal attribute values.public int hashCode()
regex, flags.public String toString()
UncompiledPattern with attribute values.public static ImmutableUncompiledPattern of(String regex, int flags)
UncompiledPattern instance.regex - The value for the regex attributeflags - The value for the flags attributepublic static ImmutableUncompiledPattern copyOf(UncompiledPattern instance)
UncompiledPattern value.
Uses accessors to get values to initialize the new immutable instance.
If an instance is already immutable, it is returned as is.instance - The instance to copypublic static ImmutableUncompiledPattern.Builder builder()
ImmutableUncompiledPattern.
ImmutableUncompiledPattern.builder()
.regex(String) // required regex
.flags(int) // required flags
.build();
Copyright © 2022. All rights reserved.