|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cascading.tuple.Tuples
public class Tuples
Class Tuples is a helper class providing common methods to manipulate Tuple
and TupleEntry
instances.
Tuple
,
TupleEntry
Field Summary | |
---|---|
static Tuple |
NULL
A constant empty Tuple instance. |
Constructor Summary | |
---|---|
Tuples()
|
Method Summary | |
---|---|
static Object[] |
asArray(Tuple tuple,
Class[] types)
Method asArray convert the given Tuple instance into an Object[]. |
static Object[] |
asArray(Tuple tuple,
Class[] types,
Object[] destination)
Method asArray convert the given Tuple instance into an Object[]. |
static Object[] |
asArray(Tuple tuple,
Object[] destination)
Method asArray copies the elements of the given Tuple instance to the given Object array. |
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 Object |
coerce(Object value,
Class type)
|
static Tuple |
coerce(Tuple tuple,
Class[] types)
Method coerce forces each element value in the given Tuple to the corresponding primitive type. |
static Object |
coerce(Tuple tuple,
int pos,
Class type)
Method coerce returns the value in the tuple at the given position to the requested type. |
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 Tuple |
setOnEmpty(TupleEntry baseEntry,
TupleEntry valuesEntry)
|
static boolean |
toBoolean(Object value)
|
static double |
toDouble(Object value)
|
static float |
toFloat(Object value)
|
static int |
toInteger(Object value)
|
static long |
toLong(Object value)
|
static short |
toShort(Object value)
|
static String |
toString(Object value)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Tuple NULL
Constructor Detail |
---|
public Tuples()
Method Detail |
---|
public static Object[] asArray(Tuple tuple, Object[] destination)
tuple
- of type Tupledestination
- of type Object[]
public static Object[] asArray(Tuple tuple, 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[]
public static Object[] asArray(Tuple tuple, Class[] types, 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 Object coerce(Tuple tuple, int pos, Class type)
tuple
- of type Tuplepos
- of type inttype
- of type Class
public static Object coerce(Object value, Class type)
public static final String toString(Object value)
public static final int toInteger(Object value)
public static final long toLong(Object value)
public static final double toDouble(Object value)
public static final float toFloat(Object value)
public static final short toShort(Object value)
public static final boolean toBoolean(Object value)
public static Tuple coerce(Tuple tuple, Class[] types)
tuple
- of type Tupletypes
- of type Class[]
public static Tuple extractTuple(TupleEntry tupleEntry, Fields selector)
tupleEntry
- of type TupleEntryselector
- of type Fields
public static Tuple extract(TupleEntry tupleEntry, Fields selector)
tupleEntry
- of type TupleEntryselector
- of type Fields
public static Tuple setOnEmpty(TupleEntry baseEntry, TupleEntry valuesEntry)
public static Tuple asUnmodifiable(Tuple tuple)
tuple
- of type Tuple
public static Tuple asModifiable(Tuple tuple)
tuple
- of type Tuple
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |