cascading.operation.function
Class SetValue
java.lang.Object
cascading.operation.BaseOperation
cascading.operation.function.SetValue
- All Implemented Interfaces:
- Function, Operation, Serializable
public class SetValue
- extends BaseOperation
- implements Function
Class SetValue is a utility Function
that allows for a Tuple value to be returned based on the outcome
of a given Filter
operation.
There are only two possible values, either Filter.isRemove(cascading.flow.FlowProcess, cascading.operation.FilterCall)
returns true
or false
.
If false
is returned, most commonly the Filter
passed and the Tuple should be kept. SetValue will then return
the first value in the given values array, by default true
. If the Filter returns true
, the second
value in the values array will be returned, by default false
.
- See Also:
- Serialized Form
Fields inherited from interface cascading.operation.Operation |
ANY |
SetValue
@ConstructorProperties(value={"fieldDeclaration","filter"})
public SetValue(Fields fieldDeclaration,
Filter filter)
- Constructor SetValue creates a new SetValue instance.
- Parameters:
fieldDeclaration
- of type Fieldsfilter
- of type Filter
SetValue
@ConstructorProperties(value={"fieldDeclaration","filter","values"})
public SetValue(Fields fieldDeclaration,
Filter filter,
Serializable firstValue,
Serializable secondValue)
- Constructor SetValue creates a new SetValue instance.
- Parameters:
fieldDeclaration
- of type Fieldsfilter
- of type FilterfirstValue
- of type SerializablesecondValue
- of type Serializable
prepare
public void prepare(FlowProcess flowProcess,
OperationCall operationCall)
- Description copied from class:
BaseOperation
- Method prepare does nothing, and may safely be overridden.
- Specified by:
prepare
in interface Operation
- Overrides:
prepare
in class BaseOperation
operate
public void operate(FlowProcess flowProcess,
FunctionCall functionCall)
- Description copied from interface:
Function
- Method operate provides the implementation of this Function.
- Specified by:
operate
in interface Function
- Parameters:
flowProcess
- of type FlowProcessfunctionCall
- of type FunctionCall
cleanup
public void cleanup(FlowProcess flowProcess,
OperationCall operationCall)
- Description copied from class:
BaseOperation
- Method cleanup does nothing, and may safely be overridden.
- Specified by:
cleanup
in interface Operation
- Overrides:
cleanup
in class BaseOperation
equals
public boolean equals(Object object)
- Overrides:
equals
in class BaseOperation
hashCode
public int hashCode()
- Overrides:
hashCode
in class BaseOperation
Copyright © 2007-2012 Concurrent, Inc. All Rights Reserved.