Class Tuple2<A,B>

java.lang.Object
ch.tocco.nice2.toolbox.api.lang.Tuple2<A,B>
All Implemented Interfaces:
Map.Entry<A,B>

public final class Tuple2<A,B> extends Object implements Map.Entry<A,B>
  • Field Details

    • _1

      @Nullable public final A _1
    • _2

      @Nullable public final B _2
  • Constructor Details

    • Tuple2

      public Tuple2(@Nullable A _1, @Nullable B _2)
  • Method Details

    • of

      public static <A, B> Tuple2<A,B> of(@Nullable A a, @Nullable B b)
    • getKey

      @Nullable public A getKey()
      Specified by:
      getKey in interface Map.Entry<A,B>
    • requireKey

      public A requireKey()
    • getValue

      @Nullable public B getValue()
      Specified by:
      getValue in interface Map.Entry<A,B>
    • requireValue

      public B requireValue()
    • hasValue

      public boolean hasValue()
    • setValue

      public B setValue(B value)
      Specified by:
      setValue in interface Map.Entry<A,B>
    • withValue

      public <C> Tuple2<A,C> withValue(@Nullable C value)
    • withValue

      public <C> Tuple2<A,C> withValue(Function<B,C> transformer)
    • toMap

      public Map<A,B> toMap()
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in interface Map.Entry<A,B>
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Map.Entry<A,B>
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object