Package ch.njol.util

Class Pair<T1,T2>

java.lang.Object
ch.njol.util.Pair<T1,T2>
All Implemented Interfaces:
Serializable, Cloneable, Map.Entry<T1,T2>
Direct Known Subclasses:
NonNullPair

@Deprecated public class Pair<T1,T2> extends Object implements Map.Entry<T1,T2>, Cloneable, Serializable
Deprecated.
Use a use-case specific record.
See Also:
  • Field Details

    • first

      protected @UnknownNullability T1 first
      Deprecated.
    • second

      protected @UnknownNullability T2 second
      Deprecated.
  • Constructor Details

    • Pair

      public Pair()
      Deprecated.
    • Pair

      public Pair(@Nullable T1 first, @Nullable T2 second)
      Deprecated.
    • Pair

      public Pair(@NotNull @NotNull Map.Entry<T1,T2> entry)
      Deprecated.
  • Method Details

    • getFirst

      public @UnknownNullability T1 getFirst()
      Deprecated.
    • setFirst

      public void setFirst(@Nullable T1 first)
      Deprecated.
    • getSecond

      public @UnknownNullability T2 getSecond()
      Deprecated.
    • setSecond

      public void setSecond(@Nullable T2 second)
      Deprecated.
    • toString

      public String toString()
      Deprecated.
      Overrides:
      toString in class Object
      Returns:
      "first,second"
    • equals

      public final boolean equals(@Nullable @Nullable Object obj)
      Deprecated.
      Checks for equality with Entries to match hashCode()
      Specified by:
      equals in interface Map.Entry<T1,T2>
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Deprecated.
      As defined by Map.Entry.hashCode()
      Specified by:
      hashCode in interface Map.Entry<T1,T2>
      Overrides:
      hashCode in class Object
    • getKey

      public @UnknownNullability T1 getKey()
      Deprecated.
      Specified by:
      getKey in interface Map.Entry<T1,T2>
    • getValue

      public @UnknownNullability T2 getValue()
      Deprecated.
      Specified by:
      getValue in interface Map.Entry<T1,T2>
    • setValue

      public @UnknownNullability T2 setValue(@Nullable T2 value)
      Deprecated.
      Specified by:
      setValue in interface Map.Entry<T1,T2>
    • clone

      public Pair<T1,T2> clone()
      Deprecated.
      Overrides:
      clone in class Object
      Returns:
      a shallow copy of this pair