Class Triplet<U,V,W>

java.lang.Object
org.incendo.cloud.type.tuple.Triplet<U,V,W>
Type Parameters:
U - First type
V - Second type
W - Third type
All Implemented Interfaces:
Tuple

@API(status=STABLE) public class Triplet<U,V,W> extends Object implements Tuple
Immutable generic 3-tuple
  • Constructor Details

  • Method Details

    • of

      public static <U, V, W> @NonNull Triplet<@NonNull U,@NonNull V,@NonNull W> of(@NonNull U first, @NonNull V second, @NonNull W third)
      Create a new 3-tuple
      Type Parameters:
      U - First type
      V - Second type
      W - Third type
      Parameters:
      first - First value
      second - Second value
      third - Third value
      Returns:
      Created triplet
    • first

      public final U first()
      Get the first value
      Returns:
      First value
    • second

      public final V second()
      Get the second value
      Returns:
      Second value
    • third

      public final W third()
      Get the third value
      Returns:
      Third value
    • equals

      public final boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public final String toString()
      Overrides:
      toString in class Object
    • size

      public final int size()
      Description copied from interface: Tuple
      Returns the tuple size.
      Specified by:
      size in interface Tuple
      Returns:
      tuple size
    • toArray

      public final @NonNull Object @NonNull [] toArray()
      Description copied from interface: Tuple
      Turns the tuple into a type erased array.
      Specified by:
      toArray in interface Tuple
      Returns:
      created array