com.kuka.common
Class Pair<A,B>

java.lang.Object
  extended by com.kuka.common.Pair<A,B>
Type Parameters:
A - The type of the first element.
B - The type of the second element.

public class Pair<A,B>
extends Object

Represents a pair of data.


Constructor Summary
Pair()
          Creates a new pair.
Pair(A a, B b)
          Creates a new pair.
 
Method Summary
static
<A,B> Pair<A,B>
create(A a, B b)
          Creates a new pair.
 boolean equals(Object obj)
           
 A getA()
          Gets the first element.
 B getB()
          Gets the second element.
 int hashCode()
           
 void setA(A a)
          Sets the first element.
 void setB(B b)
          Sets the second element.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pair

public Pair(A a,
            B b)
Creates a new pair.

Parameters:
a - The first data.
b - The second data.

Pair

public Pair()
Creates a new pair.

Method Detail

create

public static <A,B> Pair<A,B> create(A a,
                                     B b)
Creates a new pair.

Type Parameters:
A - The type of the first element.
B - The type of the second element.
Parameters:
a - The first data.
b - The second data.
Returns:
the new pair

getA

public A getA()
Gets the first element.

Returns:
The first element.

setA

public void setA(A a)
Sets the first element.

Parameters:
a - The first element.

getB

public B getB()
Gets the second element.

Returns:
The second element.

setB

public void setB(B b)
Sets the second element.

Parameters:
b - The second element.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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


Copyright © 2019. All rights reserved.