Class Pair<L,R>

java.lang.Object
org.owasp.dependencycheck.utils.Pair<L,R>
Type Parameters:
L - the type for the left element in the pair
R - the type for the right element in the pair

@ThreadSafe public class Pair<L,R> extends Object
A generic pair of elements.
Author:
Jeremy Long
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new empty pair.
    Pair(L left, R right)
    Constructs a new Pair with the given left and right values.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Determines the equality of this and the provided object.
    Get the value of left.
    Get the value of right.
    int
    Generates the hash code using the hash codes from the contained objects.
    void
    setLeft(L left)
    Set the value of left.
    void
    setRight(R right)
    Set the value of right.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Pair

      public Pair()
      Constructs a new empty pair.
    • Pair

      public Pair(L left, R right)
      Constructs a new Pair with the given left and right values.
      Parameters:
      left - the value for the left pair
      right - the value for the right pair
  • Method Details

    • getLeft

      public L getLeft()
      Get the value of left.
      Returns:
      the value of left
    • setLeft

      public void setLeft(L left)
      Set the value of left.
      Parameters:
      left - new value of left
    • getRight

      public R getRight()
      Get the value of right.
      Returns:
      the value of right
    • setRight

      public void setRight(R right)
      Set the value of right.
      Parameters:
      right - new value of right
    • hashCode

      public int hashCode()
      Generates the hash code using the hash codes from the contained objects.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code of the Pair
    • equals

      public boolean equals(Object obj)
      Determines the equality of this and the provided object.
      Overrides:
      equals in class Object
      Parameters:
      obj - the Object to check for equality to this
      Returns:
      true if this and the provided Object are equal; otherwise false