Class RuleCase


  • public class RuleCase
    extends Object
    A RuleCase represents one case for a FieldRule, with a test, a list of assignments for an insert operation, and a list of assignments for an update operation. The first case whose test is true will be executed. If none are true and there is a default case, that case will be executed. If the RuleCase used as default includes a test, the test will be ignored.
    Since:
    2.1.4
    • Constructor Detail

      • RuleCase

        public RuleCase()
    • Method Detail

      • getTest

        public String getTest()
        This method returns the test for this RuleCase
        Returns:
        the test for the RuleCase
      • setTest

        public void setTest​(String test)
        The method is used to set the test for the RuleCase. Note that this will be ignored when used as a default RuleCase.
        Parameters:
        test - the test to set.
      • addInsertAssignment

        public void addInsertAssignment​(Assignment assignment)
        Add one insertAssignment to the RuleCase.
        Parameters:
        assignment - the insert Assignment.
      • setInsertAssignments

        public void setInsertAssignments​(List<Assignment> insertAssignments)
      • addUpdateAssignment

        public void addUpdateAssignment​(Assignment assignment)
        Add one updateAssignment to the RuleCase.
        Parameters:
        assignment - the update Assignment.
      • setUpdateAssignments

        public void setUpdateAssignments​(List<Assignment> updateAssignments)
      • addFieldAssignment

        public void addFieldAssignment​(String fieldName,
                                       String insertValue,
                                       String updateValue)
        Shortcut for the most common case of adding a field assignment with an insert and an update value
        Parameters:
        fieldName - The field name. Required
        insertValue - Insert Value. May be null
        updateValue - Update Value. May be null
      • isComplete

        public boolean isComplete​(boolean testRequired)
        Method is used to check completeness of the RuleCase.
        Parameters:
        testRequired - the boolean flag if true, the test is required for this RuleCase, if false, test is not required.
        Returns:
        true if the RuleCase is complete, false otherwise.