Package pl.poznan.put.types
Class ImmutableQuadruple<T>
- java.lang.Object
-
- pl.poznan.put.types.ImmutableQuadruple<T>
-
- All Implemented Interfaces:
Quadruple<T>
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableQuadruple<T> extends Object implements Quadruple<T>
Immutable implementation ofQuadruple.Use the builder to create immutable instances:
ImmutableQuadruple.builder(). Use the static factory method to create immutable instances:ImmutableQuadruple.of().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableQuadruple.Builder<T>Builds instances of typeImmutableQuadruple.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Ta()Tb()static <T> ImmutableQuadruple.Builder<T>builder()Creates a builder forImmutableQuadruple.Tc()static <T> ImmutableQuadruple<T>copyOf(Quadruple<T> instance)Creates an immutable copy of aQuadruplevalue.Td()booleanequals(Object another)This instance is equal to all instances ofImmutableQuadruplethat have equal attribute values.inthashCode()Computes a hash code from attributes:a,b,c,d.static <T> ImmutableQuadruple<T>of(T a, T b, T c, T d)Construct a new immutableQuadrupleinstance.StringtoString()Prints the immutable valueQuadruplewith attribute values.ImmutableQuadruple<T>withA(T value)Copy the current immutable object by setting a value for theaattribute.ImmutableQuadruple<T>withB(T value)Copy the current immutable object by setting a value for thebattribute.ImmutableQuadruple<T>withC(T value)Copy the current immutable object by setting a value for thecattribute.ImmutableQuadruple<T>withD(T value)Copy the current immutable object by setting a value for thedattribute.
-
-
-
Method Detail
-
withA
public final ImmutableQuadruple<T> withA(T value)
Copy the current immutable object by setting a value for theaattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for a- Returns:
- A modified copy of the
thisobject
-
withB
public final ImmutableQuadruple<T> withB(T value)
Copy the current immutable object by setting a value for thebattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for b- Returns:
- A modified copy of the
thisobject
-
withC
public final ImmutableQuadruple<T> withC(T value)
Copy the current immutable object by setting a value for thecattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for c- Returns:
- A modified copy of the
thisobject
-
withD
public final ImmutableQuadruple<T> withD(T value)
Copy the current immutable object by setting a value for thedattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for d- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableQuadruplethat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:a,b,c,d.
-
toString
public String toString()
Prints the immutable valueQuadruplewith attribute values.
-
of
public static <T> ImmutableQuadruple<T> of(T a, T b, T c, T d)
Construct a new immutableQuadrupleinstance.- Type Parameters:
T- generic parameter T- Parameters:
a- The value for theaattributeb- The value for thebattributec- The value for thecattributed- The value for thedattribute- Returns:
- An immutable Quadruple instance
-
copyOf
public static <T> ImmutableQuadruple<T> copyOf(Quadruple<T> instance)
Creates an immutable copy of aQuadruplevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Type Parameters:
T- generic parameter T- Parameters:
instance- The instance to copy- Returns:
- A copied immutable Quadruple instance
-
builder
public static <T> ImmutableQuadruple.Builder<T> builder()
Creates a builder forImmutableQuadruple.ImmutableQuadruple.<T>builder() .a(T) // requireda.b(T) // requiredb.c(T) // requiredc.d(T) // requiredd.build();- Type Parameters:
T- generic parameter T- Returns:
- A new ImmutableQuadruple builder
-
-