public class SetValue extends BaseOperation implements Function
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
.
fieldDeclaration, numArgs, trace
Constructor and Description |
---|
SetValue(Fields fieldDeclaration,
Filter filter)
Constructor SetValue creates a new SetValue instance.
|
SetValue(Fields fieldDeclaration,
Filter filter,
java.io.Serializable firstValue,
java.io.Serializable secondValue)
Constructor SetValue creates a new SetValue instance.
|
Modifier and Type | Method and Description |
---|---|
void |
cleanup(FlowProcess flowProcess,
OperationCall operationCall)
Method cleanup does nothing, and may safely be overridden.
|
boolean |
equals(java.lang.Object object) |
java.io.Serializable |
getFirstValue() |
java.io.Serializable |
getSecondValue() |
int |
hashCode() |
void |
operate(FlowProcess flowProcess,
FunctionCall functionCall)
Method operate provides the implementation of this Function.
|
void |
prepare(FlowProcess flowProcess,
OperationCall operationCall)
Method prepare does nothing, and may safely be overridden.
|
flush, getFieldDeclaration, getNumArgs, getTrace, isSafe, printOperationInternal, toString, toStringInternal
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
flush, getFieldDeclaration, getNumArgs, isSafe
@ConstructorProperties(value={"fieldDeclaration","filter"}) public SetValue(Fields fieldDeclaration, Filter filter)
fieldDeclaration
- of type Fieldsfilter
- of type Filter@ConstructorProperties(value={"fieldDeclaration","filter","firstValue","secondValue"}) public SetValue(Fields fieldDeclaration, Filter filter, java.io.Serializable firstValue, java.io.Serializable secondValue)
fieldDeclaration
- of type Fieldsfilter
- of type FilterfirstValue
- of type SerializablesecondValue
- of type Serializablepublic java.io.Serializable getFirstValue()
public java.io.Serializable getSecondValue()
public void prepare(FlowProcess flowProcess, OperationCall operationCall)
BaseOperation
prepare
in interface Operation
prepare
in class BaseOperation
public void operate(FlowProcess flowProcess, FunctionCall functionCall)
Function
public void cleanup(FlowProcess flowProcess, OperationCall operationCall)
BaseOperation
cleanup
in interface Operation
cleanup
in class BaseOperation
public boolean equals(java.lang.Object object)
equals
in class BaseOperation
public int hashCode()
hashCode
in class BaseOperation
Copyright © 2007-2015 Xplenty, Inc. All Rights Reserved.