public final class ImmutableOneOf extends OneOf
OneOf.
Use the builder to create immutable instances:
ImmutableOneOf.builder().
Use the static factory method to create immutable instances:
ImmutableOneOf.of().
| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableOneOf.Builder
Builds instances of type
ImmutableOneOf. |
| Modifier and Type | Method and Description |
|---|---|
static ImmutableOneOf.Builder |
builder()
Creates a builder for
ImmutableOneOf. |
static ImmutableOneOf |
copyOf(OneOf instance)
Creates an immutable copy of a
OneOf value. |
boolean |
equals(Object another)
This instance is equal to all instances of
ImmutableOneOf that have equal attribute values. |
int |
hashCode()
Computes a hash code from attributes:
pecularities. |
static ImmutableOneOf |
of(Iterable<? extends DistinctPeculiarity<?>> pecularities)
Construct a new immutable
OneOf instance. |
static ImmutableOneOf |
of(List<DistinctPeculiarity<?>> pecularities)
Construct a new immutable
OneOf instance. |
List<DistinctPeculiarity<?>> |
pecularities() |
String |
toString()
Prints the immutable value
OneOf with attribute values. |
ImmutableOneOf |
withPecularities(DistinctPeculiarity<?>... elements)
Copy the current immutable object with elements that replace the content of
pecularities. |
ImmutableOneOf |
withPecularities(Iterable<? extends DistinctPeculiarity<?>> elements)
Copy the current immutable object with elements that replace the content of
pecularities. |
public List<DistinctPeculiarity<?>> pecularities()
pecularities in class OneOfpecularities attribute@SafeVarargs public final ImmutableOneOf withPecularities(DistinctPeculiarity<?>... elements)
pecularities.elements - The elements to setthis objectpublic final ImmutableOneOf withPecularities(Iterable<? extends DistinctPeculiarity<?>> elements)
pecularities.
A shallow reference equality check is used to prevent copying of the same value by returning this.elements - An iterable of pecularities elements to setthis objectpublic boolean equals(Object another)
ImmutableOneOf that have equal attribute values.public int hashCode()
pecularities.public String toString()
OneOf with attribute values.public static ImmutableOneOf of(List<DistinctPeculiarity<?>> pecularities)
OneOf instance.pecularities - The value for the pecularities attributepublic static ImmutableOneOf of(Iterable<? extends DistinctPeculiarity<?>> pecularities)
OneOf instance.pecularities - The value for the pecularities attributepublic static ImmutableOneOf copyOf(OneOf instance)
OneOf 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 ImmutableOneOf.Builder builder()
ImmutableOneOf.
ImmutableOneOf.builder()
.addPecularities|addAllPecularities(de.flapdoodle.os.common.DistinctPeculiarity<?>) // pecularities elements
.build();
Copyright © 2021. All rights reserved.