@Generated(value="org.immutables.processor.ProxyProcessor") public final class ImmutableSome<T> extends Maybe.Some<T>
Maybe.Some.
Use the builder to create immutable instances:
ImmutableSome.builder().
Use the static factory method to create immutable instances:
ImmutableSome.of().
| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableSome.Builder<T>
Builds instances of type
ImmutableSome. |
Maybe.None<T>, Maybe.Some<T>| Modifier and Type | Method and Description |
|---|---|
static <T> ImmutableSome.Builder<T> |
builder()
Creates a builder for
ImmutableSome. |
static <T> ImmutableSome<T> |
copyOf(Maybe.Some<T> instance)
Creates an immutable copy of a
Maybe.Some value. |
boolean |
equals(Object another)
This instance is equal to all instances of
ImmutableSome that have equal attribute values. |
int |
hashCode()
Computes a hash code from attributes:
value. |
static <T> ImmutableSome<T> |
of(T value)
Construct a new immutable
Some instance. |
String |
toString()
Prints the immutable value
Some with attribute values. |
protected T |
value() |
ImmutableSome<T> |
withValue(T value)
Copy the current immutable object by setting a value for the
value attribute. |
get, hasSome, mapgetOrThrow, none, some@Nullable protected T value()
value in class Maybe.Some<T>value attributepublic final ImmutableSome<T> withValue(@Nullable T value)
value attribute.
A shallow reference equality check is used to prevent copying of the same value by returning this.value - A new value for value (can be null)this objectpublic boolean equals(Object another)
ImmutableSome that have equal attribute values.public int hashCode()
value.public String toString()
Some with attribute values.public static <T> ImmutableSome<T> of(@Nullable T value)
Some instance.T - generic parameter Tvalue - The value for the value attributepublic static <T> ImmutableSome<T> copyOf(Maybe.Some<T> instance)
Maybe.Some 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> ImmutableSome.Builder<T> builder()
ImmutableSome.
ImmutableSome.<T>builder()
.value(T | null) // nullable value
.build();
T - generic parameter TCopyright © 2025. All rights reserved.