public abstract class NestedBaseCopyFunction<Node,Result> extends NestedSpecBaseOperation<Node,Result,NestedBaseCopyFunction.Context> implements Function<NestedBaseCopyFunction.Context>
Function
implementations that rely on the
CopySpec
class when declaring transformations on nested object types.
Specifically, *CopyAsFunction
and *CopyIntoFunction
classes create or update (respectively)
nested object types from a Function argument where the field value is a nest object type.
In the case of a *CopyIntoFunction
the last argument in the arguments
TupleEntry
will be
the object the CopySpec copies values into.
In the case of a *CopyAsFunction
a new root object will be created for the CopySpec to copy values into.
Note the arguments TupleEntry will be passed to any Transform
instances that are resettable
Transform.isResettable()
allowing for parameterized transformations on child values as they are copied
to the new location.
In the case of JSON objects, a single JSON object is selected as an argument so that values contained in that object can be copied into the new object.
For selecting the values from multiple existing field values in order to create a new object or update an existing one
see NestedBaseBuildFunction
sub-classes.
CopySpec
,
Serialized FormModifier and Type | Class and Description |
---|---|
protected static class |
NestedBaseCopyFunction.Context |
Modifier and Type | Field and Description |
---|---|
protected heretical.pointer.operation.Copier<Node,Result> |
copier |
nestedCoercibleType
fieldDeclaration, numArgs, trace
Constructor and Description |
---|
NestedBaseCopyFunction(NestedCoercibleType<Node,Result> nestedCoercibleType,
Fields fieldDeclaration,
CopySpec... copySpecs) |
Modifier and Type | Method and Description |
---|---|
void |
operate(FlowProcess flowProcess,
FunctionCall<NestedBaseCopyFunction.Context> functionCall) |
void |
prepare(FlowProcess flowProcess,
OperationCall<NestedBaseCopyFunction.Context> operationCall) |
protected void |
resetTransforms(TupleEntry arguments,
Fields fields) |
getArgument, getResultNode, isInto
deepCopy, getCoercibleType, getLiteralNode, getNestedPointerCompiler, getRootNode, iterable
cleanup, equals, flush, getFieldDeclaration, getNumArgs, getTrace, hashCode, isSafe, printOperationInternal, toString, toStringInternal
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
cleanup, flush, getFieldDeclaration, getNumArgs, isSafe
public NestedBaseCopyFunction(NestedCoercibleType<Node,Result> nestedCoercibleType, Fields fieldDeclaration, CopySpec... copySpecs)
public void prepare(FlowProcess flowProcess, OperationCall<NestedBaseCopyFunction.Context> operationCall)
prepare
in interface Operation<NestedBaseCopyFunction.Context>
prepare
in class BaseOperation<NestedBaseCopyFunction.Context>
public void operate(FlowProcess flowProcess, FunctionCall<NestedBaseCopyFunction.Context> functionCall)
operate
in interface Function<NestedBaseCopyFunction.Context>
protected void resetTransforms(TupleEntry arguments, Fields fields)
Copyright © 2007-2017 Cascading Maintainers. All Rights Reserved.