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(since="2.10.0", forRemoval=true) public class Pair<T1,T2> extends Object implements Map.Entry<T1,T2>, Cloneable, Serializable
Deprecated, for removal: This API element is subject to removal in a future version.
Use a use-case specific record instead.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected @UnknownNullability T1
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected @UnknownNullability T2
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Pair(@NotNull Map.Entry<T1,T2> entry)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Pair(T1 first, T2 second)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    final boolean
    equals(@Nullable Object obj)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Checks for equality with Entries to match hashCode()
    @UnknownNullability T1
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    @UnknownNullability T1
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    @UnknownNullability T2
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    @UnknownNullability T2
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    final int
    Deprecated, for removal: This API element is subject to removal in a future version.
    As defined by Map.Entry.hashCode()
    void
    setFirst(T1 first)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    setSecond(T2 second)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    @UnknownNullability T2
    setValue(T2 value)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • first

      protected @UnknownNullability T1 first
      Deprecated, for removal: This API element is subject to removal in a future version.
    • second

      protected @UnknownNullability T2 second
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Constructor Details

    • Pair

      public Pair()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • Pair

      public Pair(@Nullable T1 first, @Nullable T2 second)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • Pair

      public Pair(@NotNull @NotNull Map.Entry<T1,T2> entry)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • getFirst

      public @UnknownNullability T1 getFirst()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setFirst

      public void setFirst(@Nullable T1 first)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getSecond

      public @UnknownNullability T2 getSecond()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setSecond

      public void setSecond(@Nullable T2 second)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • toString

      public String toString()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      toString in class Object
      Returns:
      "first,second"
    • equals

      public final boolean equals(@Nullable @Nullable Object obj)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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, for removal: This API element is subject to removal in a future version.
      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, for removal: This API element is subject to removal in a future version.
      Specified by:
      getKey in interface Map.Entry<T1,T2>
    • getValue

      public @UnknownNullability T2 getValue()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getValue in interface Map.Entry<T1,T2>
    • setValue

      public @UnknownNullability T2 setValue(@Nullable T2 value)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      setValue in interface Map.Entry<T1,T2>
    • clone

      public Pair<T1,T2> clone()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      clone in class Object
      Returns:
      a shallow copy of this pair