Class SplicingOptions

Object
SplicingOptions

public class SplicingOptions extends Object
Class for splicing process of Condition Records. These options are applied to all CRCI items touched by splicing process.

The options are:
  • set - allows define the value which will be set to defined CR column - Except for key values and validity period values
  • reset - allows to set value to null to defined CR column - Except for key values and validity period values
  • withSupersedingOn - allows to set superseding mode during the splicing

Examples

Examples of usage for each option.

Set value to column

conditionRecordHelper.withSplicingOption().set("attribute1", "BoT")

Reset value in column

conditionRecordHelper.withSplicingOption().reset("attribute1")

Set superseding ON

conditionRecordHelper.withSplicingOption().setSupersedingOn()

  • Constructor Details

    • SplicingOptions

      public SplicingOptions()
  • Method Details

    • getSetFields

      public Map<String,Object> getSetFields()
      Get fields (key in map) that should be set to certain value (value in map).
      Returns:
      Map of field names (key) and field values (value) to be set during splicing process.
    • getResetFields

      public Set<String> getResetFields()
      Get list of fields that should be set to null value (reset).
      Returns:
      List of field names to be set to null value during splicing process.
    • set

      public SplicingOptions set(String fieldName, Object fieldValue)
      Set option to set field with given fieldName name value to given fieldValue value. These values are set for all CRCI items touched by splicing process.
      Parameters:
      fieldName - Name of field to be set.
      fieldValue - Value of the field to be set.
      Returns:
      SplicingOptions
    • reset

      public SplicingOptions reset(String fieldName)
      Set option to reset field value to null. This value is set for all CRCI items touched by splicing process.
      Parameters:
      fieldName - Name of field to be reset.
      Returns:
      SplicingOptions
    • validateOptions

      public SplicingOptions validateOptions() throws IllegalArgumentException
      Validate correctness of all options set by user. Throws an exception, if any option is incorrect.
      Incorrect option can be:
      • clash of set and reset fields - User can't put the same attribute to set and reset fields
      • null value in set fields - Example of incorrect usage: conditionRecordHelper.withSplicingOption().set("attribute1", null). To set to null use reset(String) function.
      Returns:
      SplicingOptions
      Throws:
      IllegalArgumentException - If any option is incorrect.
    • getSupersedeRecords

      public boolean getSupersedeRecords()
      Realize if records are superseded or deleted. If setSupersedingOn() is called, returns true. If not used, returns false (default).
      Returns:
      True if records are superseded (moved to historical table), or false if they are deleted.
    • setSupersedingOn

      public SplicingOptions setSupersedingOn()
      Set superseding function ON, which archive items instead of deleting them. OFF by default.
      Returns:
      SplicingOptions