cascading.operation.function

## Class SetValue

- java.lang.Object
- - cascading.operation.BaseOperation
  - - cascading.operation.function.SetValue

All Implemented Interfaces:
  DeclaresResults, Function, Operation, Traceable, java.io.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

### Field Summary

### Fields inherited from class cascading.operation.BaseOperation

`fieldDeclaration, numArgs, trace`

### Fields inherited from interface cascading.operation.Operation

`ANY`

### Constructor Summary

Constructors
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.

### Method Summary

Methods
`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.

### Methods inherited from class cascading.operation.BaseOperation

`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

`flush, getFieldDeclaration, getNumArgs, isSafe`

### Constructor Detail

#### SetValue

    @ConstructorProperties(value={"fieldDeclaration","filter"})
    public SetValue(Fields fieldDeclaration,
                                  Filter filter)

Constructor SetValue creates a new SetValue instance.

Parameters:
  `fieldDeclaration` - of type Fields
  `filter` - of type Filter

#### SetValue

    @ConstructorProperties(value={"fieldDeclaration","filter","firstValue","secondValue"})
    public SetValue(Fields fieldDeclaration,
                                  Filter filter,
                                  java.io.Serializable firstValue,
                                  java.io.Serializable secondValue)

Constructor SetValue creates a new SetValue instance.

Parameters:
  `fieldDeclaration` - of type Fields
  `filter` - of type Filter
  `firstValue` - of type Serializable
  `secondValue` - of type Serializable

### Method Detail

#### getFirstValue

    public java.io.Serializable getFirstValue()

#### getSecondValue

    public java.io.Serializable getSecondValue()

#### 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 FlowProcess
  `functionCall` - 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(java.lang.Object object)

Overrides:
  `equals` in class `BaseOperation`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `BaseOperation`