Class Tuple3<A,B,C>
java.lang.Object
org.apache.juneau.commons.function.Tuple3<A,B,C>
- Type Parameters:
A- Object 1 type.B- Object 2 type.C- Object 3 type.
Represents a simple tuple of 3 objects.
This class is useful when you need a three-value composite key for HashMap lookups that properly implements
equals(Object) and hashCode() based on content rather than identity.
Array Support:
Unlike using arrays directly as HashMap keys, this class properly handles arrays by using
content-based equality and hashing via HashCode.of(Object...) which internally uses
Arrays.hashCode(Object[]) for arrays.
See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetA()Returns the first object in this tuple.getB()Returns the second object in this tuple.getC()Returns the third object in this tuple.inthashCode()static <A,B, C> Tuple3<A, B, C> of(A a, B b, C c) Static creator.optA()Returns the first object in this tuple wrapped in anOptional.optB()Returns the second object in this tuple wrapped in anOptional.optC()Returns the third object in this tuple wrapped in anOptional.
-
Constructor Details
-
Tuple3
Constructor.- Parameters:
a- Object 1.b- Object 2.c- Object 3.
-
-
Method Details
-
of
Static creator.- Type Parameters:
A- Object 1 type.B- Object 2 type.C- Object 3 type.- Parameters:
a- Object 1.b- Object 2.c- Object 3.- Returns:
- A new tuple object.
-
equals
-
getA
Returns the first object in this tuple.- Returns:
- The first object in this tuple.
-
getB
Returns the second object in this tuple.- Returns:
- The second object in this tuple.
-
getC
Returns the third object in this tuple.- Returns:
- The third object in this tuple.
-
optA
Returns the first object in this tuple wrapped in anOptional.- Returns:
- The first object wrapped in an Optional, or Optional.empty() if the value is null.
-
optB
Returns the second object in this tuple wrapped in anOptional.- Returns:
- The second object wrapped in an Optional, or Optional.empty() if the value is null.
-
optC
Returns the third object in this tuple wrapped in anOptional.- Returns:
- The third object wrapped in an Optional, or Optional.empty() if the value is null.
-
hashCode
-