Class MutablePair.SimpleMutablePair<F,S>

java.lang.Object
ru.progrm_jarvis.javacommons.object.MutablePair.SimpleMutablePair<F,S>
Type Parameters:
F - type of the first value
S - type of the second value
All Implemented Interfaces:
MutablePair<F,S>, Pair<F,S>
Enclosing interface:
MutablePair<F,S>

public static final class MutablePair.SimpleMutablePair<F,S> extends Object implements MutablePair<F,S>
Simple implementation of MutablePair.
  • Method Details

    • getFirst

      public F getFirst()
      Description copied from interface: Pair
      Gets the first value.
      Specified by:
      getFirst in interface Pair<F,S>
      Returns:
      the first value
    • getSecond

      public S getSecond()
      Description copied from interface: Pair
      Gets the second value.
      Specified by:
      getSecond in interface Pair<F,S>
      Returns:
      the second value
    • setFirst

      public void setFirst(F first)
      Description copied from interface: MutablePair
      Sets the first value to the one given.
      Specified by:
      setFirst in interface MutablePair<F,S>
      Parameters:
      first - the value to set as the first
    • setSecond

      public void setSecond(S second)
      Description copied from interface: MutablePair
      Sets the second value to the one given.
      Specified by:
      setSecond in interface MutablePair<F,S>
      Parameters:
      second - the value to set as the second
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object