Class ImmutableEvaluatedDecisionValue

java.lang.Object
io.camunda.zeebe.protocol.record.value.ImmutableEvaluatedDecisionValue
All Implemented Interfaces:
JsonSerializable, RecordValue, EvaluatedDecisionValue, TenantOwned

public final class ImmutableEvaluatedDecisionValue extends Object implements EvaluatedDecisionValue
Immutable implementation of EvaluatedDecisionValue.

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

  • Method Details

    • getTenantId

      public String getTenantId()
      Returns the identifier of the tenant that owns this entity.
      Specified by:
      getTenantId in interface TenantOwned
    • getDecisionId

      public String getDecisionId()
      Specified by:
      getDecisionId in interface EvaluatedDecisionValue
      Returns:
      the id of the evaluated decision
    • getDecisionName

      public String getDecisionName()
      Specified by:
      getDecisionName in interface EvaluatedDecisionValue
      Returns:
      the name of the evaluated decision
    • getDecisionKey

      public long getDecisionKey()
      Specified by:
      getDecisionKey in interface EvaluatedDecisionValue
      Returns:
      the key of the evaluated decision
    • getDecisionVersion

      public int getDecisionVersion()
      Specified by:
      getDecisionVersion in interface EvaluatedDecisionValue
      Returns:
      the version of the evaluated decision
    • getDecisionType

      public String getDecisionType()
      Specified by:
      getDecisionType in interface EvaluatedDecisionValue
      Returns:
      the type of the evaluated decision
    • getDecisionOutput

      public String getDecisionOutput()
      Specified by:
      getDecisionOutput in interface EvaluatedDecisionValue
      Returns:
      the output of the evaluated decision as JSON string
    • getEvaluatedInputs

      public List<EvaluatedInputValue> getEvaluatedInputs()
      If the decision is a decision table then it returns the evaluated inputs. The inputs are not available for other types of decision.
      Specified by:
      getEvaluatedInputs in interface EvaluatedDecisionValue
      Returns:
      the evaluated inputs, or an empty list if the decision is not a decision table
    • getMatchedRules

      public List<MatchedRuleValue> getMatchedRules()
      If the decision is a decision table then it returns the matched rules. The matched rules are not available for other types of decision.
      Specified by:
      getMatchedRules in interface EvaluatedDecisionValue
      Returns:
      the matched rules, or an empty list if the decision is not a decision table
    • withTenantId

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

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

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

      public final ImmutableEvaluatedDecisionValue withDecisionKey(long value)
      Copy the current immutable object by setting a value for the decisionKey attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for decisionKey
      Returns:
      A modified copy of the this object
    • withDecisionVersion

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

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

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

      public final ImmutableEvaluatedDecisionValue withEvaluatedInputs(EvaluatedInputValue... elements)
      Copy the current immutable object with elements that replace the content of evaluatedInputs.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withEvaluatedInputs

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

      public final ImmutableEvaluatedDecisionValue withMatchedRules(MatchedRuleValue... elements)
      Copy the current immutable object with elements that replace the content of matchedRules.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withMatchedRules

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

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableEvaluatedDecisionValue 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: tenantId, decisionId, decisionName, decisionKey, decisionVersion, decisionType, decisionOutput, evaluatedInputs, matchedRules.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      Creates an immutable copy of a EvaluatedDecisionValue 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 EvaluatedDecisionValue instance
    • builder

      public static ImmutableEvaluatedDecisionValue.Builder builder()
      Creates a builder for ImmutableEvaluatedDecisionValue.
       ImmutableEvaluatedDecisionValue.builder()
          .withTenantId(String | null) // nullable tenantId
          .withDecisionId(String | null) // nullable decisionId
          .withDecisionName(String | null) // nullable decisionName
          .withDecisionKey(long) // optional decisionKey
          .withDecisionVersion(int) // optional decisionVersion
          .withDecisionType(String | null) // nullable decisionType
          .withDecisionOutput(String | null) // nullable decisionOutput
          .addEvaluatedInput|addAllEvaluatedInputs(io.camunda.zeebe.protocol.record.value.EvaluatedInputValue) // evaluatedInputs elements
          .addMatchedRule|addAllMatchedRules(io.camunda.zeebe.protocol.record.value.MatchedRuleValue) // matchedRules elements
          .build();
       
      Returns:
      A new ImmutableEvaluatedDecisionValue builder