Class ImmutableMatchedRuleValue

java.lang.Object
io.camunda.zeebe.protocol.record.value.ImmutableMatchedRuleValue
All Implemented Interfaces:
JsonSerializable, RecordValue, MatchedRuleValue

public final class ImmutableMatchedRuleValue extends Object implements MatchedRuleValue
Immutable implementation of MatchedRuleValue.

Use the builder to create immutable instances: ImmutableMatchedRuleValue.builder().

  • Method Details

    • getRuleId

      public String getRuleId()
      Specified by:
      getRuleId in interface MatchedRuleValue
      Returns:
      the id of the matched rule
    • getRuleIndex

      public int getRuleIndex()
      Returns the index of the matched rule in the decision table, starting with 1.
      Specified by:
      getRuleIndex in interface MatchedRuleValue
      Returns:
      the index of the matched rule
    • getEvaluatedOutputs

      public List<EvaluatedOutputValue> getEvaluatedOutputs()
      Specified by:
      getEvaluatedOutputs in interface MatchedRuleValue
      Returns:
      the evaluated outputs of the rule
    • withRuleId

      public final ImmutableMatchedRuleValue withRuleId(String value)
      Copy the current immutable object by setting a value for the ruleId attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for ruleId (can be null)
      Returns:
      A modified copy of the this object
    • withRuleIndex

      public final ImmutableMatchedRuleValue withRuleIndex(int value)
      Copy the current immutable object by setting a value for the ruleIndex attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for ruleIndex
      Returns:
      A modified copy of the this object
    • withEvaluatedOutputs

      public final ImmutableMatchedRuleValue withEvaluatedOutputs(EvaluatedOutputValue... elements)
      Copy the current immutable object with elements that replace the content of evaluatedOutputs.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withEvaluatedOutputs

      public final ImmutableMatchedRuleValue withEvaluatedOutputs(Iterable<? extends EvaluatedOutputValue> elements)
      Copy the current immutable object with elements that replace the content of evaluatedOutputs. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of evaluatedOutputs elements to set
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableMatchedRuleValue that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Returns a lazily computed hash code from attributes: ruleId, ruleIndex, evaluatedOutputs.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value MatchedRuleValue with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutableMatchedRuleValue copyOf(MatchedRuleValue instance)
      Creates an immutable copy of a MatchedRuleValue value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable MatchedRuleValue instance
    • builder

      public static ImmutableMatchedRuleValue.Builder builder()
      Creates a builder for ImmutableMatchedRuleValue.
       ImmutableMatchedRuleValue.builder()
          .withRuleId(String | null) // nullable ruleId
          .withRuleIndex(int) // optional ruleIndex
          .addEvaluatedOutput|addAllEvaluatedOutputs(io.camunda.zeebe.protocol.record.value.EvaluatedOutputValue) // evaluatedOutputs elements
          .build();
       
      Returns:
      A new ImmutableMatchedRuleValue builder