Class Triplet<U,V,W>

java.lang.Object
cloud.commandframework.types.tuples.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 Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Triplet(@NonNull U first, @NonNull V second, @NonNull W third)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
     
    final U
    Get the first value
    final V
    Get the second value
    final int
    Get the tuple size
    final W
    Get the third value
    final int
     
    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
    final @NonNull Object @NonNull []
    Turn the tuple into a type erased array
    final String
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Triplet

      protected Triplet(@NonNull U first, @NonNull V second, @NonNull W third)
  • 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
    • getFirst

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

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

      public final W getThird()
      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
    • getSize

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

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