Package org.organicdesign.fp.tuple
Class Tuple9<A,B,C,D,E,F,G,H,I>
- java.lang.Object
-
- org.organicdesign.fp.tuple.Tuple9<A,B,C,D,E,F,G,H,I>
-
- All Implemented Interfaces:
Serializable
public class Tuple9<A,B,C,D,E,F,G,H,I> extends Object implements Serializable
Holds 9 items of potentially different types. Designed to let you easily create immutable subclasses (to give your data structures meaningful names) with correct equals(), hashCode(), and toString() methods.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description A
_1()
Returns the 1st fieldB
_2()
Returns the 2nd fieldC
_3()
Returns the 3rd fieldD
_4()
Returns the 4th fieldE
_5()
Returns the 5th fieldF
_6()
Returns the 6th fieldG
_7()
Returns the 7th fieldH
_8()
Returns the 8th fieldI
_9()
Returns the 9th fieldboolean
equals(Object other)
int
hashCode()
static <A,B,C,D,E,F,G,H,I>
Tuple9<A,B,C,D,E,F,G,H,I>of(A a, B b, C c, D d, E e, F f, G g, H h, I i)
Public static factory methodString
toString()
-
-
-
Constructor Detail
-
Tuple9
protected Tuple9(A a, B b, C c, D d, E e, F f, G g, H h, I i)
Constructor is protected (not public) for easy inheritance. Josh Bloch's "Item 1" says public static factory methods are better than constructors because they have names, they can return an existing object instead of a new one, and they can return a sub-type. Therefore, you have more flexibility with a static factory as part of your public API then with a public constructor.
-
-
Method Detail
-
of
public static <A,B,C,D,E,F,G,H,I> Tuple9<A,B,C,D,E,F,G,H,I> of(A a, B b, C c, D d, E e, F f, G g, H h, I i)
Public static factory method
-
_1
public A _1()
Returns the 1st field
-
_2
public B _2()
Returns the 2nd field
-
_3
public C _3()
Returns the 3rd field
-
_4
public D _4()
Returns the 4th field
-
_5
public E _5()
Returns the 5th field
-
_6
public F _6()
Returns the 6th field
-
_7
public G _7()
Returns the 7th field
-
_8
public H _8()
Returns the 8th field
-
_9
public I _9()
Returns the 9th field
-
-