cascading.operation
Class Identity

java.lang.Object
  extended by cascading.operation.BaseOperation<cascading.operation.Identity.Functor>
      extended by cascading.operation.Identity
All Implemented Interfaces:
DeclaresResults, Function<cascading.operation.Identity.Functor>, Operation<cascading.operation.Identity.Functor>, Traceable, Serializable

public class Identity
extends BaseOperation<cascading.operation.Identity.Functor>
implements Function<cascading.operation.Identity.Functor>

The Identity function simply passes incoming arguments back out again. Optionally argument fields can be renamed, and/or coerced into specific types.

During coercion, 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.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class cascading.operation.BaseOperation
fieldDeclaration, numArgs, trace
 
Fields inherited from interface cascading.operation.Operation
ANY
 
Constructor Summary
Identity()
          Constructor Identity creates a new Identity instance that will pass the argument values to its output.
Identity(Class... types)
          Constructor Identity creates a new Identity instance that will coerce the values to the give types.
Identity(Fields fieldDeclaration)
          Constructor Identity creates a new Identity instance that will rename the argument fields to the given fieldDeclaration.
Identity(Fields fieldDeclaration, Class... types)
          Constructor Identity creates a new Identity instance that will rename the argument fields to the given fieldDeclaration, and coerce the values to the give types.
 
Method Summary
 boolean equals(Object object)
           
 Type[] getTypes()
           
 int hashCode()
           
 void operate(FlowProcess flowProcess, FunctionCall<cascading.operation.Identity.Functor> functionCall)
          Method operate provides the implementation of this Function.
 void prepare(FlowProcess flowProcess, OperationCall<cascading.operation.Identity.Functor> operationCall)
          Method prepare does nothing, and may safely be overridden.
 
Methods inherited from class cascading.operation.BaseOperation
cleanup, flush, getFieldDeclaration, getNumArgs, getTrace, isSafe, printOperationInternal, toString, toStringInternal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface cascading.operation.Operation
cleanup, flush, getFieldDeclaration, getNumArgs, isSafe
 

Constructor Detail

Identity

public Identity()
Constructor Identity creates a new Identity instance that will pass the argument values to its output. Use this constructor for a simple copy Pipe.


Identity

@ConstructorProperties(value="types")
public Identity(Class... types)
Constructor Identity creates a new Identity instance that will coerce the values to the give types.

Parameters:
types - of type Class...

Identity

@ConstructorProperties(value="fieldDeclaration")
public Identity(Fields fieldDeclaration)
Constructor Identity creates a new Identity instance that will rename the argument fields to the given fieldDeclaration.

Parameters:
fieldDeclaration - of type Fields

Identity

@ConstructorProperties(value={"fieldDeclaration","types"})
public Identity(Fields fieldDeclaration,
                                           Class... types)
Constructor Identity creates a new Identity instance that will rename the argument fields to the given fieldDeclaration, and coerce the values to the give types.

Parameters:
fieldDeclaration - of type Fields
types - of type Class...
Method Detail

getTypes

public Type[] getTypes()

prepare

public void prepare(FlowProcess flowProcess,
                    OperationCall<cascading.operation.Identity.Functor> operationCall)
Description copied from class: BaseOperation
Method prepare does nothing, and may safely be overridden.

Specified by:
prepare in interface Operation<cascading.operation.Identity.Functor>
Overrides:
prepare in class BaseOperation<cascading.operation.Identity.Functor>

operate

public void operate(FlowProcess flowProcess,
                    FunctionCall<cascading.operation.Identity.Functor> functionCall)
Description copied from interface: Function
Method operate provides the implementation of this Function.

Specified by:
operate in interface Function<cascading.operation.Identity.Functor>
Parameters:
flowProcess - of type FlowProcess
functionCall - of type FunctionCall

equals

public boolean equals(Object object)
Overrides:
equals in class BaseOperation<cascading.operation.Identity.Functor>

hashCode

public int hashCode()
Overrides:
hashCode in class BaseOperation<cascading.operation.Identity.Functor>


Copyright © 2007-2015 Concurrent, Inc. All Rights Reserved.