Class FieldCopier

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:
  • Constructor Details

    • 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 request
      input - 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 request
      input - 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 request
      input - 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 request
      input - 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
  • Method Details

    • copyToOutput

      public void copyToOutput()
      Sets the values of the bound outputs to the current value of their associated source. This would be either the result of evaluating the replacement function or the current value of the matching bound input field.