Kie Commons Data 6.0.0.CR4

org.kie.commons.data
Class Pair<K1,K2>

java.lang.Object
  extended by org.kie.commons.data.Pair<K1,K2>
Type Parameters:
K1 -
K2 -

public class Pair<K1,K2>
extends Object

This is a simple class to store a pair of objects.


Nested Class Summary
static class Pair.PairEqualsMode
           
 
Constructor Summary
Pair(K1 k1, K2 k2)
          Creates a new pair using the two keys provided.
Pair(K1 k1, K2 k2, Pair.PairEqualsMode equalsMode)
          Creates a new pair using the two keys provided.
 
Method Summary
 boolean equals(Object o)
           
 K1 getK1()
           
 K2 getK2()
           
 int hashCode()
           
static
<K1,K2> Pair<K1,K2>
newPair(K1 k1, K2 k2)
          static factory method
static
<K1,K2> Pair<K1,K2>
newPair(K1 k1, K2 k2, Pair.PairEqualsMode equalsMode)
          static factory method
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pair

public Pair(K1 k1,
            K2 k2)
Creates a new pair using the two keys provided.

Parameters:
k1 -
k2 -

Pair

public Pair(K1 k1,
            K2 k2,
            Pair.PairEqualsMode equalsMode)
Creates a new pair using the two keys provided.

Parameters:
k1 -
k2 -
Method Detail

newPair

public static <K1,K2> Pair<K1,K2> newPair(K1 k1,
                                          K2 k2)
static factory method

Type Parameters:
K1 -
K2 -
Parameters:
k1 -
k2 -
Returns:

newPair

public static <K1,K2> Pair<K1,K2> newPair(K1 k1,
                                          K2 k2,
                                          Pair.PairEqualsMode equalsMode)
static factory method

Type Parameters:
K1 -
K2 -
Parameters:
k1 -
k2 -
Returns:

equals

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

getK1

public K1 getK1()
Returns:
the first key

getK2

public K2 getK2()
Returns:
the second key

hashCode

public int hashCode()
Overrides:
hashCode in class Object

Kie Commons Data 6.0.0.CR4

Copyright © 2001-2013 JBoss by Red Hat. All Rights Reserved.