Class Tuple5<V1,V2,V3,V4,V5>

java.lang.Object
io.permazen.tuple.Tuple5<V1,V2,V3,V4,V5>
Type Parameters:
V1 - first value type
V2 - second value type
V3 - third value type
V4 - fourth value type
V5 - fifth value type
All Implemented Interfaces:
Has1<V1>, Has2<V1,V2>, Has3<V1,V2,V3>, Has4<V1,V2,V3,V4>, Has5<V1,V2,V3,V4,V5>, Tuple

public class Tuple5<V1,V2,V3,V4,V5> extends Object
A tuple of five values.

Instances are immutable.

  • Constructor Details

    • Tuple5

      public Tuple5(V1 v1, V2 v2, V3 v3, V4 v4, V5 v5)
      Constructor.
      Parameters:
      v1 - the first value
      v2 - the second value
      v3 - the third value
      v4 - the fouth value
      v5 - the fifth value
  • Method Details

    • getValue5

      public V5 getValue5()
      Description copied from interface: Has5
      Get the fifth value.
      Specified by:
      getValue5 in interface Has5<V1,V2,V3,V4,V5>
      Returns:
      fifth value in this tuple
    • getSize

      public int getSize()
      Description copied from interface: Tuple
      Get the number of values in this tuple.
      Specified by:
      getSize in interface Tuple
      Returns:
      the size of this tuple
    • asList

      public List<Object> asList()
      Description copied from interface: Tuple
      View this instance as a list.
      Specified by:
      asList in interface Tuple
      Returns:
      unmodifiable List view of this tuple
    • getValue4

      public V4 getValue4()
      Description copied from interface: Has4
      Get the fourth value.
      Specified by:
      getValue4 in interface Has4<V1,V2,V3,V4>
      Returns:
      fourth value in this tuple
    • getValue3

      public V3 getValue3()
      Description copied from interface: Has3
      Get the third value.
      Specified by:
      getValue3 in interface Has3<V1,V2,V3>
      Returns:
      third value in this tuple
    • getValue2

      public V2 getValue2()
      Description copied from interface: Has2
      Get the second value.
      Specified by:
      getValue2 in interface Has2<V1,V2>
      Returns:
      second value in this tuple
    • getValue1

      public V1 getValue1()
      Description copied from interface: Has1
      Get the first value.
      Specified by:
      getValue1 in interface Has1<V1>
      Returns:
      first value in this tuple
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Description copied from interface: Tuple
      Compare for equality.

      Tuples are equal if they have the same size and the corresponding individual values are equal (or null).

      Specified by:
      equals in interface Tuple
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Description copied from interface: Tuple
      Compute hash code.

      The hash code of a tuple is the exclusive-OR of the hash codes of the individual values (using zero for null values).

      Specified by:
      hashCode in interface Tuple
      Overrides:
      hashCode in class Object