Class ImmutablePair<L,R>
java.lang.Object
io.dialob.session.engine.program.expr.arith.ImmutablePair<L,R>
- All Implemented Interfaces:
Pair<L,,R> Serializable
@Generated(from="Pair",
generator="Immutables")
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutablePair<L,R>
extends Object
implements Pair<L,R>
Immutable implementation of
Pair.
Use the builder to create immutable instances:
ImmutablePair.builder().
Use the static factory method to create immutable instances:
ImmutablePair.of().
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic <L,R> ImmutablePair.Builder <L, R> builder()Creates a builder forImmutablePair.static <L,R> ImmutablePair <L, R> Creates an immutable copy of aPairvalue.booleanThis instance is equal to all instances ofImmutablePairthat have equal attribute values.getLeft()getRight()inthashCode()Computes a hash code from attributes:left,right.static <L,R> ImmutablePair <L, R> of(L left, R right) Construct a new immutablePairinstance.toString()Prints the immutable valuePairwith attribute values.final ImmutablePair<L, R> Copy the current immutable object by setting a value for theleftattribute.final ImmutablePair<L, R> Copy the current immutable object by setting a value for therightattribute.
-
Method Details
-
getLeft
-
getRight
-
withLeft
Copy the current immutable object by setting a value for theleftattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for left- Returns:
- A modified copy or the
thisobject
-
withRight
Copy the current immutable object by setting a value for therightattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for right- Returns:
- A modified copy or the
thisobject
-
equals
This instance is equal to all instances ofImmutablePairthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:left,right. -
toString
Prints the immutable valuePairwith attribute values. -
of
Construct a new immutablePairinstance.- Type Parameters:
L- generic parameter LR- generic parameter R- Parameters:
left- The value for theleftattributeright- The value for therightattribute- Returns:
- An immutable Pair instance
-
copyOf
Creates an immutable copy of aPairvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Type Parameters:
L- generic parameter LR- generic parameter R- Parameters:
instance- The instance to copy- Returns:
- A copied immutable Pair instance
-
builder
Creates a builder forImmutablePair.ImmutablePair.<L, R>builder() .left(L) // requiredleft.right(R) // requiredright.build();- Type Parameters:
L- generic parameter LR- generic parameter R- Returns:
- A new ImmutablePair builder
-