Class ModPair<K,V>

java.lang.Object
org.pgcodekeeper.core.utils.Pair<K,V>
org.pgcodekeeper.core.utils.ModPair<K,V>
Type Parameters:
K - type of the first element
V - type of the second element
All Implemented Interfaces:
Serializable

public class ModPair<K,V> extends Pair<K,V>
Modifiable pair class extending the immutable Pair class. Provides setter methods to modify the first and second elements after construction.
See Also:
  • Constructor Details

    • ModPair

      public ModPair(K first, V second)
      Creates a new modifiable pair with specified elements.
      Parameters:
      first - the first element
      second - the second element
  • Method Details

    • setFirst

      public void setFirst(K first)
      Sets the first element of this pair.
      Parameters:
      first - the new first element
    • setSecond

      public V setSecond(V second)
      Sets the second element of this pair and returns the previous value.
      Parameters:
      second - the new second element
      Returns:
      the previous second element