cascading.pipe.assembly
Class Coerce
java.lang.Object
cascading.pipe.Pipe
cascading.pipe.SubAssembly
cascading.pipe.assembly.Coerce
- All Implemented Interfaces:
- FlowElement, Serializable
public class Coerce
- extends SubAssembly
Class Coerce is a SubAssembly
that will coerce all incoming Tuple
values to
the given types.
If the given type is a primitive (long
), and the tuple value is null, 0
is returned.
If the type is an Object (java.lang.Long
), and the tuple value is null
, null
is returned.
Coerce encapsulates the Identity
function.
- See Also:
SubAssembly
,
Identity
,
Serialized Form
Constructor Summary |
Coerce(Pipe previous,
Class... types)
Constructor Coerce creates a new Coerce instance that will coerce all input Tuple values. |
Coerce(Pipe previous,
Fields coerceFields)
Constructor Coerce creates a new Coerce instance that will only coerce the given coerceFields Tuple values. |
Coerce(Pipe previous,
Fields coerceFields,
Class... types)
Constructor Coerce creates a new Coerce instance that will only coerce the given coerceFields Tuple values. |
Methods inherited from class cascading.pipe.Pipe |
equals, getConfigDef, getHeads, getParent, getStepConfigDef, getTrace, hasConfigDef, hashCode, hasStepConfigDef, id, isEquivalentTo, named, names, outgoingScopeFor, pipes, print, printInternal, resolveIncomingOperationArgumentFields, resolveIncomingOperationPassThroughFields, setParent, toString |
Coerce
@ConstructorProperties(value={"previous","types"})
public Coerce(Pipe previous,
Class... types)
- Constructor Coerce creates a new Coerce instance that will coerce all input Tuple values.
- Parameters:
previous
- of type Pipetypes
- of type Class...
Coerce
@ConstructorProperties(value={"previous","coerceFields","types"})
public Coerce(Pipe previous,
Fields coerceFields,
Class... types)
- Constructor Coerce creates a new Coerce instance that will only coerce the given coerceFields Tuple values.
Note the resulting output Tuple will contain all the original incoming Fields.
- Parameters:
previous
- of type PipecoerceFields
- of type Fieldstypes
- of type Class...
Coerce
@ConstructorProperties(value={"previous","coerceFields"})
public Coerce(Pipe previous,
Fields coerceFields)
- Constructor Coerce creates a new Coerce instance that will only coerce the given coerceFields Tuple values.
The given
coerceFields
instance must contain field type information, otherwise an
IllegalArgumentException
will be thrown.
Note the resulting output Tuple will contain all the original incoming Fields.
- Parameters:
previous
- of type PipecoerceFields
- of type Fields
Copyright © 2007-2013 Concurrent, Inc. All Rights Reserved.