java.lang.Object
ushiosan.jvm_utilities.lang.collection.elements.Pair<T,K>
ushiosan.jvm_utilities.lang.collection.elements.Trio<T,K,V>
Type Parameters:
T - first value type
K - second value type
V - third value type

public final class Trio<T,K,V> extends Pair<T,K>
Data structure that represents 3 values within the same object. This class is very similar to what we can find with class Pair
See Also:
  • Field Details

    • third

      public final V third
      Third element
  • Constructor Details

    • Trio

      public Trio(T first, K second, V third)
      Default constructor
      Parameters:
      first - first element
      second - second element
      third - third element
  • Method Details

    • of

      @NotNull public static <T, K, V> @NotNull Trio<T,K,V> of(T first, K second, V third)
      Shortcut trio instance
      Type Parameters:
      T - generic first type
      K - generic second type
      V - generic third type
      Parameters:
      first - first value
      second - second value
      third - third value
      Returns:
      instance of Trio class
    • of

      @NotNull public static <T, K, V> @NotNull Trio<T,K,V> of(@NotNull @NotNull Pair<T,K> pair)
      Copies the content of a Pair object and converts it to a Trio object.
      Type Parameters:
      T - generic first type
      K - generic second type
      V - generic third type
      Parameters:
      pair - the pair object to copy
      Returns:
      instance of Trio class