Package org.apache.tapestry5.func
Class Tuple<A,B>
java.lang.Object
org.apache.tapestry5.func.Tuple<A,B>
- Type Parameters:
A
- first typeB
- second type
A Tuple holds two values of two different types.
- Since:
- 5.3
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <X,
Y> Tuple<X, Y> create
(X first, Y second) boolean
Compares this Tuple to another object.protected void
extendDescription
(StringBuilder builder) Overriden in subclasses to write additional values into the description.int
hashCode()
Returns a hash code value for the tuple, based on its values.protected boolean
The heart ofequals(Object)
; the other object is the same class as this object.toString()
Returns the values of the tuple, separated by commas, enclosed in parenthesis.
-
Field Details
-
first
-
second
-
-
Constructor Details
-
Tuple
-
-
Method Details
-
create
-
toString
Returns the values of the tuple, separated by commas, enclosed in parenthesis. Example:("Ace", "Spades")
. -
extendDescription
Overriden in subclasses to write additional values into the description.- Parameters:
builder
-
-
equals
Compares this Tuple to another object. Equality is defined by: other object is not null, is same class as this Tuple, and all values are themselves equal. -
hashCode
Returns a hash code value for the tuple, based on its values. -
isMatch
The heart ofequals(Object)
; the other object is the same class as this object.- Parameters:
other
- other tuple to compare- Returns:
- true if all values stored in tuple match
-