public class Tuples
extends java.lang.Object
Tuple
and TupleEntry
instances.Tuple
,
TupleEntry
Constructor and Description |
---|
Tuples() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Object[] |
asArray(Tuple tuple,
java.lang.Class[] types)
Deprecated.
|
static java.lang.Object[] |
asArray(Tuple tuple,
java.lang.Class[] types,
java.lang.Object[] destination)
Deprecated.
|
static java.lang.Object[] |
asArray(Tuple tuple,
CoercibleType[] coercions,
java.lang.Class[] types,
java.lang.Object[] destination) |
static <T> T[] |
asArray(Tuple tuple,
T[] destination)
Method asArray copies the elements of the given Tuple instance to the given Object array.
|
static java.util.Collection |
asCollection(Tuple tuple) |
static Tuple |
asModifiable(Tuple tuple)
Method asModifiable marks the given Tuple instance as modifiable.
|
static Tuple |
asUnmodifiable(Tuple tuple)
Method asUnmodifiable marks the given Tuple instance as unmodifiable.
|
static java.lang.Object |
coerce(java.lang.Object value,
java.lang.Class type)
Deprecated.
|
static Tuple |
coerce(Tuple tuple,
java.lang.Class[] types)
Deprecated.
|
static Tuple |
coerce(Tuple tuple,
java.lang.Class[] types,
Tuple destination)
Deprecated.
|
static java.lang.Object |
coerce(Tuple tuple,
int pos,
java.lang.Class type)
Deprecated.
|
static Tuple |
create(java.util.List<java.lang.Object> arrayList) |
static Tuple |
extract(TupleEntry tupleEntry,
Fields selector)
Method extract creates a new Tuple from the given selector, but sets the values in the current tuple to null.
|
static Tuple |
extractTuple(TupleEntry tupleEntry,
Fields selector)
Method extractTuple returns a new Tuple based on the given selector.
|
static int |
frequency(TupleEntry tupleEntry,
java.lang.Object value)
Method frequency behaves the same as
Collections.frequency(java.util.Collection, Object) . |
static int |
frequency(Tuple tuple,
java.lang.Object value)
Method frequency behaves the same as
Collections.frequency(java.util.Collection, Object) . |
static Tuple |
nulledCopy(Fields declarator,
Tuple tuple,
Fields selector) |
static Tuple |
nulledCopy(TupleEntry tupleEntry,
Fields selector) |
static Tuple |
setOnEmpty(TupleEntry baseEntry,
TupleEntry valuesEntry) |
static Tuple |
setUnmodifiable(Tuple tuple,
boolean isUnmodifiable) |
static boolean |
toBoolean(java.lang.Object value)
Deprecated.
|
static java.lang.Boolean |
toBooleanObject(java.lang.Object value)
Deprecated.
|
static double |
toDouble(java.lang.Object value)
Deprecated.
|
static java.lang.Double |
toDoubleObject(java.lang.Object value)
Deprecated.
|
static float |
toFloat(java.lang.Object value)
Deprecated.
|
static java.lang.Float |
toFloatObject(java.lang.Object value)
Deprecated.
|
static int |
toInteger(java.lang.Object value)
Deprecated.
|
static java.lang.Integer |
toIntegerObject(java.lang.Object value)
Deprecated.
|
static long |
toLong(java.lang.Object value)
Deprecated.
|
static java.lang.Long |
toLongObject(java.lang.Object value)
Deprecated.
|
static short |
toShort(java.lang.Object value)
Deprecated.
|
static java.lang.Short |
toShortObject(java.lang.Object value)
Deprecated.
|
static java.lang.String |
toString(java.lang.Object value)
Deprecated.
|
static Tuple |
tuple(java.lang.Object a)
A utility function for use with Janino expressions to get around its lack of support for varargs.
|
static Tuple |
tuple(java.lang.Object a,
java.lang.Object b)
A utility function for use with Janino expressions to get around its lack of support for varargs.
|
static Tuple |
tuple(java.lang.Object a,
java.lang.Object b,
java.lang.Object c)
A utility function for use with Janino expressions to get around its lack of support for varargs.
|
static Tuple |
tuple(java.lang.Object a,
java.lang.Object b,
java.lang.Object c,
java.lang.Object d)
A utility function for use with Janino expressions to get around its lack of support for varargs.
|
static Tuple |
tuple(java.lang.Object a,
java.lang.Object b,
java.lang.Object c,
java.lang.Object d,
java.lang.Object e)
A utility function for use with Janino expressions to get around its lack of support for varargs.
|
static Tuple |
tuple(java.lang.Object a,
java.lang.Object b,
java.lang.Object c,
java.lang.Object d,
java.lang.Object e,
java.lang.Object f)
A utility function for use with Janino expressions to get around its lack of support for varargs.
|
static Tuple |
tuple(java.lang.Object a,
java.lang.Object b,
java.lang.Object c,
java.lang.Object d,
java.lang.Object e,
java.lang.Object f,
java.lang.Object g)
A utility function for use with Janino expressions to get around its lack of support for varargs.
|
static Tuple |
tuple(java.lang.Object a,
java.lang.Object b,
java.lang.Object c,
java.lang.Object d,
java.lang.Object e,
java.lang.Object f,
java.lang.Object g,
java.lang.Object h)
A utility function for use with Janino expressions to get around its lack of support for varargs.
|
public static Tuple tuple(java.lang.Object a)
a
- of type Objectpublic static Tuple tuple(java.lang.Object a, java.lang.Object b)
a
- of type Objectb
- of type Objectpublic static Tuple tuple(java.lang.Object a, java.lang.Object b, java.lang.Object c)
a
- of type Objectb
- of type Objectc
- of type Objectpublic static Tuple tuple(java.lang.Object a, java.lang.Object b, java.lang.Object c, java.lang.Object d)
a
- of type Objectb
- of type Objectc
- of type Objectd
- of type Objectpublic static Tuple tuple(java.lang.Object a, java.lang.Object b, java.lang.Object c, java.lang.Object d, java.lang.Object e)
a
- of type Objectb
- of type Objectc
- of type Objectd
- of type Objecte
- of type Objectpublic static Tuple tuple(java.lang.Object a, java.lang.Object b, java.lang.Object c, java.lang.Object d, java.lang.Object e, java.lang.Object f)
a
- of type Objectb
- of type Objectc
- of type Objectd
- of type Objecte
- of type Objectf
- of type Objectpublic static Tuple tuple(java.lang.Object a, java.lang.Object b, java.lang.Object c, java.lang.Object d, java.lang.Object e, java.lang.Object f, java.lang.Object g)
a
- of type Objectb
- of type Objectc
- of type Objectd
- of type Objecte
- of type Objectf
- of type Objectg
- of type Objectpublic static Tuple tuple(java.lang.Object a, java.lang.Object b, java.lang.Object c, java.lang.Object d, java.lang.Object e, java.lang.Object f, java.lang.Object g, java.lang.Object h)
a
- of type Objectb
- of type Objectc
- of type Objectd
- of type Objecte
- of type Objectf
- of type Objectg
- of type Objecth
- of type Objectpublic static <T> T[] asArray(Tuple tuple, T[] destination)
tuple
- of type Tupledestination
- of type Object[]@Deprecated public static java.lang.Object[] asArray(Tuple tuple, java.lang.Class[] types)
Tuple
instance into an Object[]. The given Class[] array
denotes the types each tuple element value should be coerced into.
Coercion types are Object, String, Integer, Long, Float, Double, Short, and Boolean.
If all Tuple element values are null, they will remain null for String and Object, but become zero for the numeric types.
The string value 'true' can be converted to the boolean true.tuple
- of type Tupletypes
- of type Class[]@Deprecated public static java.lang.Object[] asArray(Tuple tuple, java.lang.Class[] types, java.lang.Object[] destination)
Tuple
instance into an Object[]. The given Class[] array
denotes the types each tuple element value should be coerced into.tuple
- of type Tupletypes
- of type Class[]destination
- of type Object[]public static java.lang.Object[] asArray(Tuple tuple, CoercibleType[] coercions, java.lang.Class[] types, java.lang.Object[] destination)
public static java.util.Collection asCollection(Tuple tuple)
public static int frequency(Tuple tuple, java.lang.Object value)
Collections.frequency(java.util.Collection, Object)
.
This method is a convenient way to test for all null values in a tuple.tuple
- of type Tuplevalue
- of type Objectpublic static int frequency(TupleEntry tupleEntry, java.lang.Object value)
Collections.frequency(java.util.Collection, Object)
.
This method is a convenient way to test for all null values in a tuple.tupleEntry
- of type TupleEntryvalue
- of type Object@Deprecated public static java.lang.Object coerce(Tuple tuple, int pos, java.lang.Class type)
tuple
- of type Tuplepos
- of type inttype
- of type Class@Deprecated public static java.lang.Object coerce(java.lang.Object value, java.lang.Class type)
@Deprecated public static final java.lang.String toString(java.lang.Object value)
@Deprecated public static final int toInteger(java.lang.Object value)
@Deprecated public static final long toLong(java.lang.Object value)
@Deprecated public static final double toDouble(java.lang.Object value)
@Deprecated public static final float toFloat(java.lang.Object value)
@Deprecated public static final short toShort(java.lang.Object value)
@Deprecated public static final boolean toBoolean(java.lang.Object value)
@Deprecated public static final java.lang.Integer toIntegerObject(java.lang.Object value)
@Deprecated public static final java.lang.Long toLongObject(java.lang.Object value)
@Deprecated public static final java.lang.Double toDoubleObject(java.lang.Object value)
@Deprecated public static final java.lang.Float toFloatObject(java.lang.Object value)
@Deprecated public static final java.lang.Short toShortObject(java.lang.Object value)
@Deprecated public static final java.lang.Boolean toBooleanObject(java.lang.Object value)
@Deprecated public static Tuple coerce(Tuple tuple, java.lang.Class[] types)
tuple
- of type Tupletypes
- of type Class[]@Deprecated public static Tuple coerce(Tuple tuple, java.lang.Class[] types, Tuple destination)
tuple
- of type Tupletypes
- of type Class[]destination
- of type Tuplepublic static Tuple extractTuple(TupleEntry tupleEntry, Fields selector)
tupleEntry
- of type TupleEntryselector
- of type Fieldspublic static Tuple extract(TupleEntry tupleEntry, Fields selector)
tupleEntry
- of type TupleEntryselector
- of type Fieldspublic static Tuple nulledCopy(TupleEntry tupleEntry, Fields selector)
public static Tuple setOnEmpty(TupleEntry baseEntry, TupleEntry valuesEntry)
public static Tuple asUnmodifiable(Tuple tuple)
tuple
- of type Tuplepublic static Tuple asModifiable(Tuple tuple)
tuple
- of type Tuplepublic static Tuple create(java.util.List<java.lang.Object> arrayList)