public final class ImmutablePeculiarity<T> extends Object implements Peculiarity<T>
Peculiarity.
Use the builder to create immutable instances:
ImmutablePeculiarity.builder().
| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutablePeculiarity.Builder<T>
Builds instances of type
ImmutablePeculiarity. |
| Modifier and Type | Method and Description |
|---|---|
Attribute<T> |
attribute() |
static <T> ImmutablePeculiarity.Builder<T> |
builder()
Creates a builder for
ImmutablePeculiarity. |
static <T> ImmutablePeculiarity<T> |
copyOf(Peculiarity<T> instance)
Creates an immutable copy of a
Peculiarity value. |
boolean |
equals(Object another)
This instance is equal to all instances of
ImmutablePeculiarity that have equal attribute values. |
int |
hashCode()
Computes a hash code from attributes:
attribute, match. |
Match<T> |
match() |
String |
toString()
Prints the immutable value
Peculiarity with attribute values. |
ImmutablePeculiarity<T> |
withAttribute(Attribute<T> value)
Copy the current immutable object by setting a value for the
attribute attribute. |
ImmutablePeculiarity<T> |
withMatch(Match<T> value)
Copy the current immutable object by setting a value for the
match attribute. |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitofpublic Attribute<T> attribute()
attribute in interface Peculiarity<T>attribute attributepublic Match<T> match()
match in interface Peculiarity<T>match attributepublic final ImmutablePeculiarity<T> withAttribute(Attribute<T> value)
attribute attribute.
A shallow reference equality check is used to prevent copying of the same value by returning this.value - A new value for attributethis objectpublic final ImmutablePeculiarity<T> withMatch(Match<T> value)
match attribute.
A shallow reference equality check is used to prevent copying of the same value by returning this.value - A new value for matchthis objectpublic boolean equals(Object another)
ImmutablePeculiarity that have equal attribute values.public int hashCode()
attribute, match.public String toString()
Peculiarity with attribute values.public static <T> ImmutablePeculiarity<T> copyOf(Peculiarity<T> instance)
Peculiarity value.
Uses accessors to get values to initialize the new immutable instance.
If an instance is already immutable, it is returned as is.T - generic parameter Tinstance - The instance to copypublic static <T> ImmutablePeculiarity.Builder<T> builder()
ImmutablePeculiarity.
ImmutablePeculiarity.<T>builder()
.attribute(de.flapdoodle.os.common.attributes.Attribute<T>) // required attribute
.match(de.flapdoodle.os.common.matcher.Match<T>) // required match
.build();
builder in interface Peculiarity<T>T - generic parameter TCopyright © 2021. All rights reserved.