Class 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 of Quadruple.

    Use the builder to create immutable instances: ImmutableQuadruple.builder(). Use the static factory method to create immutable instances: ImmutableQuadruple.of().

    • Method Detail

      • a

        public T a()
        Specified by:
        a in interface Quadruple<T>
        Returns:
        The value of the a attribute
      • b

        public T b()
        Specified by:
        b in interface Quadruple<T>
        Returns:
        The value of the b attribute
      • c

        public T c()
        Specified by:
        c in interface Quadruple<T>
        Returns:
        The value of the c attribute
      • d

        public T d()
        Specified by:
        d in interface Quadruple<T>
        Returns:
        The value of the d attribute
      • withA

        public final ImmutableQuadruple<T> withA​(T value)
        Copy the current immutable object by setting a value for the a attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for a
        Returns:
        A modified copy of the this object
      • withB

        public final ImmutableQuadruple<T> withB​(T value)
        Copy the current immutable object by setting a value for the b attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for b
        Returns:
        A modified copy of the this object
      • withC

        public final ImmutableQuadruple<T> withC​(T value)
        Copy the current immutable object by setting a value for the c attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for c
        Returns:
        A modified copy of the this object
      • withD

        public final ImmutableQuadruple<T> withD​(T value)
        Copy the current immutable object by setting a value for the d attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for d
        Returns:
        A modified copy of the this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableQuadruple that have equal attribute values.
        Overrides:
        equals in class Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: a, b, c, d.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

        public String toString()
        Prints the immutable value Quadruple with attribute values.
        Overrides:
        toString in class Object
        Returns:
        A string representation of the value
      • of

        public static <T> ImmutableQuadruple<T> of​(T a,
                                                   T b,
                                                   T c,
                                                   T d)
        Construct a new immutable Quadruple instance.
        Type Parameters:
        T - generic parameter T
        Parameters:
        a - The value for the a attribute
        b - The value for the b attribute
        c - The value for the c attribute
        d - The value for the d attribute
        Returns:
        An immutable Quadruple instance
      • copyOf

        public static <T> ImmutableQuadruple<T> copyOf​(Quadruple<T> instance)
        Creates an immutable copy of a Quadruple value. 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 for ImmutableQuadruple.
         ImmutableQuadruple.&lt;T&gt;builder()
            .a(T) // required a
            .b(T) // required b
            .c(T) // required c
            .d(T) // required d
            .build();
         
        Type Parameters:
        T - generic parameter T
        Returns:
        A new ImmutableQuadruple builder