public final class Tuples extends Object
| Modifier and Type | Method and Description |
|---|---|
static Class<? extends org.javatuples.Tuple> |
classOfTuple(int cardinality)
Finds for a cardinality the associated tuple class, eg.
|
static Class<? extends org.javatuples.Tuple> |
classOfTuple(List<?> objects) |
static Class<? extends org.javatuples.Tuple> |
classOfTuple(Object... objects)
Finds for a list of object the associated tuple class, eg.
|
static <TUPLE extends org.javatuples.Tuple> |
create(List<?> objects)
Transforms a list of object into a tuple.
|
static <TUPLE extends org.javatuples.Tuple> |
create(Object firstObject,
Object... objects)
Transforms an array of object into a tuple.
|
static <TUPLE extends org.javatuples.Tuple> |
createTupleFromList(List<Object> objects)
Deprecated.
Use the shorter
create method instead. |
static <TUPLE extends org.javatuples.Tuple> |
createTupleFromList(Object... objects)
Deprecated.
Use the shorter
create method instead. |
static <T> List<T> |
toList(org.javatuples.Tuple tuple) |
static List<?> |
toListOfClasses(org.javatuples.Tuple tuple) |
static ParameterizedType |
typeOfTuple(Class<?>... classes)
Gets the final tuple type for a list of class.
|
public static <TUPLE extends org.javatuples.Tuple> TUPLE create(List<?> objects)
TUPLE - the tuple typeobjects - the list of objectorg.seedstack.seed.SeedException - if the array length is greater than 10public static <TUPLE extends org.javatuples.Tuple> TUPLE create(Object firstObject, Object... objects)
TUPLE - the tuple typefirstObject - the first item of the tupleobjects - the array of objectorg.seedstack.seed.SeedException - if the array length is greater than 10@Deprecated public static <TUPLE extends org.javatuples.Tuple> TUPLE createTupleFromList(Object... objects)
create method instead.TUPLE - the tuple typeobjects - the array of objectorg.seedstack.seed.SeedException - if the array length is greater than 10@Deprecated public static <TUPLE extends org.javatuples.Tuple> TUPLE createTupleFromList(List<Object> objects)
create method instead.TUPLE - the tuple typeobjects - the list of objectorg.seedstack.seed.SeedException - if the array length is greater than 10public static Class<? extends org.javatuples.Tuple> classOfTuple(Object... objects)
Pair for a list of two objects,
a Triplet for a list of three, etc...objects - the list of objectspublic static Class<? extends org.javatuples.Tuple> classOfTuple(int cardinality)
Pair for 2, a Triplet for 3, etc...cardinality - the cardinality of the tuplepublic static ParameterizedType typeOfTuple(Class<?>... classes)
For instance, for a list with Customer.class and Order.class the method will return Pair<Customer, Order>.
classes - the tuple's classespublic static <T> List<T> toList(org.javatuples.Tuple tuple)
public static List<?> toListOfClasses(org.javatuples.Tuple tuple)
Copyright © 2013-2016–2016 SeedStack. All rights reserved.