- java.lang.Object
-
- com.pervasive.datarush.ports.physical.FieldCopier
-
public class FieldCopier extends Object
A utility class for copying a set of input values to output fields. Values can come from either specified inputs or functions over those same inputs.This utility is intended for cases when
DeriveFields
cannot be used, but similar function is required within the implementation of a process.- See Also:
ScalarValuedFunction
-
-
Constructor Summary
Constructors Constructor Description FieldCopier(ScalarOutputField[] outputs, RecordValued input)
Creates a setter binding the specified output fields to the provided input values.FieldCopier(ScalarOutputField[] outputs, RecordValued input, Map<String,ScalarValuedFunction> replacements)
Creates a setter binding the specified output fields to the provided input values and functions.FieldCopier(RecordSettable target, RecordValued source)
Creates a setter binding the specified output buffer to the provided input values.FieldCopier(RecordSettable target, RecordValued source, Map<String,ScalarValuedFunction> replacements)
Creates a setter binding the specified output buffer to the provided input values and functions.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
copyToOutput()
Sets the values of the bound outputs to the current value of their associated source.
-
-
-
Constructor Detail
-
FieldCopier
public FieldCopier(RecordSettable target, RecordValued source)
Creates a setter binding the specified output buffer to the provided input values. Each output field is bound to the input field of the same name. If no input field of the same name exists, the output field is unbound and will have an undefined value on copy.- Parameters:
target
- the output buffer to set on a copy requestinput
- the values to use as the source for copy
-
FieldCopier
public FieldCopier(ScalarOutputField[] outputs, RecordValued input)
Creates a setter binding the specified output fields to the provided input values. Each output field is bound to the input field of the same name. If no input field of the same name exists, the output field is unbound and will have an undefined value on copy.- Parameters:
outputs
- the output fields to set on a copy requestinput
- the values to use as the source for copy
-
FieldCopier
public FieldCopier(RecordSettable target, RecordValued source, Map<String,ScalarValuedFunction> replacements)
Creates a setter binding the specified output buffer to the provided input values and functions. Each output field will be bound to a value using the following process:- If an entry exists in the replacement map for the field name, the replacement function will provide the value for the output field on a copy.
- If no replacement function is specified, the matching input field of the same name will provide the value for the output field on a copy.
- If no matching field exists in the input, the output field remains unbound and will have an undefined value on a copy.
- Parameters:
target
- the output buffer to set on a copy requestinput
- the values to use as the source for copy; this is also the input domain used for evaluating replacement functions.replacements
- a collection of functions providing output values for fields
-
FieldCopier
public FieldCopier(ScalarOutputField[] outputs, RecordValued input, Map<String,ScalarValuedFunction> replacements)
Creates a setter binding the specified output fields to the provided input values and functions. Each output field will be bound to a value using the following process:- If an entry exists in the replacement map for the field name, the replacement function will provide the value for the output field on a copy.
- If no replacement function is specified, the matching input field of the same name will provide the value for the output field on a copy.
- If no matching field exists in the input, the output field remains unbound and will have an undefined value on a copy.
- Parameters:
outputs
- the output fields to set on a copy requestinput
- the values to use as the source for copy; this is also the input domain used for evaluating replacement functions.replacements
- a collection of functions providing output values for fields
-
-