|
|||||||||
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
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
|
asArray(Tuple tuple,
T[] 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 Tuple |
coerce(Tuple tuple,
Class[] types,
Tuple destination)
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 |
create(List<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 Tuple |
nulledCopy(Fields declarator,
Tuple tuple,
Fields selector)
|
|
static Tuple |
nulledCopy(TupleEntry tupleEntry,
Fields selector)
|
|
static Tuple |
setOnEmpty(TupleEntry baseEntry,
TupleEntry valuesEntry)
|
|
static boolean |
toBoolean(Object value)
|
|
static Boolean |
toBooleanObject(Object value)
|
|
static double |
toDouble(Object value)
|
|
static Double |
toDoubleObject(Object value)
|
|
static float |
toFloat(Object value)
|
|
static Float |
toFloatObject(Object value)
|
|
static int |
toInteger(Object value)
|
|
static Integer |
toIntegerObject(Object value)
|
|
static long |
toLong(Object value)
|
|
static Long |
toLongObject(Object value)
|
|
static short |
toShort(Object value)
|
|
static Short |
toShortObject(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 |
Constructor Detail |
---|
public Tuples()
Method Detail |
---|
public static <T> T[] asArray(Tuple tuple, T[] 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 final Integer toIntegerObject(Object value)
public static final Long toLongObject(Object value)
public static final Double toDoubleObject(Object value)
public static final Float toFloatObject(Object value)
public static final Short toShortObject(Object value)
public static final Boolean toBooleanObject(Object value)
public static Tuple coerce(Tuple tuple, Class[] types)
tuple
- of type Tupletypes
- of type Class[]
public static Tuple coerce(Tuple tuple, Class[] types, Tuple destination)
tuple
- of type Tupletypes
- of type Class[]destination
- of type Tuple
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 nulledCopy(TupleEntry tupleEntry, Fields selector)
public static Tuple nulledCopy(Fields declarator, Tuple tuple, Fields selector)
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
public static Tuple create(List<Object> arrayList)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |