Class Triple<T1,T2,T3>

java.lang.Object
net.automatalib.common.util.string.AbstractPrintable
net.automatalib.common.util.Triple<T1,T2,T3>
Type Parameters:
T1 - type of the first component
T2 - type of the second component
T3 - type of the third component
All Implemented Interfaces:
Printable

public final class Triple<T1,T2,T3> extends AbstractPrintable
Immutable triple class.

Note: this class should only be used for internal representations of tuples with value type semantics (e.g. equality, only if all components are equal).

Whenever a public interface returns an aggregation of individual objects, a separate class should be created/used that has meaningful identifiers for the individual components.

  • Method Details

    • of

      public static <T1, T2, T3> Triple<T1,T2,T3> of(T1 first, T2 second, T3 third)
      Creates a new triple from the given components.
      Type Parameters:
      T1 - type of the first component
      T2 - type of the second component
      T3 - type of the third component
      Parameters:
      first - the first triple component
      second - the second triple component
      third - the third triple component
      Returns:
      the new triple object
    • getFirst

      public T1 getFirst()
    • getSecond

      public T2 getSecond()
    • getThird

      public T3 getThird()
    • print

      public void print(Appendable a) throws IOException
      Description copied from interface: Printable
      Outputs the current object.
      Parameters:
      a - the appendable.
      Throws:
      IOException - if an error occurs during appending.
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object