Class ImmutableDecisionRecordValue

java.lang.Object
io.camunda.zeebe.protocol.record.value.deployment.ImmutableDecisionRecordValue
All Implemented Interfaces:
JsonSerializable, RecordValue, DecisionRecordValue

@ParametersAreNonnullByDefault @Immutable public final class ImmutableDecisionRecordValue extends Object implements DecisionRecordValue
Immutable implementation of DecisionRecordValue.

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

  • Method Details

    • getDecisionId

      public String getDecisionId()
      Specified by:
      getDecisionId in interface DecisionRecordValue
      Returns:
      the ID of the decision in the DMN
    • getDecisionName

      public String getDecisionName()
      Specified by:
      getDecisionName in interface DecisionRecordValue
      Returns:
      the name of the decision in the DMN
    • getVersion

      public int getVersion()
      Specified by:
      getVersion in interface DecisionRecordValue
      Returns:
      the version of the deployed decision
    • getDecisionKey

      public long getDecisionKey()
      Specified by:
      getDecisionKey in interface DecisionRecordValue
      Returns:
      the key of the deployed decision
    • getDecisionRequirementsId

      public String getDecisionRequirementsId()
      Specified by:
      getDecisionRequirementsId in interface DecisionRecordValue
      Returns:
      the ID of the DRG in the DMN this decision belongs to
    • getDecisionRequirementsKey

      public long getDecisionRequirementsKey()
      Specified by:
      getDecisionRequirementsKey in interface DecisionRecordValue
      Returns:
      the key of the deployed DRG this decision belongs to
    • isDuplicate

      public boolean isDuplicate()
      Specified by:
      isDuplicate in interface DecisionRecordValue
      Returns:
      true if the decision is a duplicate (and has been deployed previously), otherwise false
    • withDecisionId

      public final ImmutableDecisionRecordValue 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 ImmutableDecisionRecordValue 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
    • withVersion

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

      public final ImmutableDecisionRecordValue 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
    • withDecisionRequirementsId

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

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

      public final ImmutableDecisionRecordValue withDuplicate(boolean value)
      Copy the current immutable object by setting a value for the duplicate attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for duplicate
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableDecisionRecordValue 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: decisionId, decisionName, version, decisionKey, decisionRequirementsId, decisionRequirementsKey, duplicate.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableDecisionRecordValue copyOf(DecisionRecordValue instance)
      Creates an immutable copy of a DecisionRecordValue 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 DecisionRecordValue instance
    • builder

      public static ImmutableDecisionRecordValue.Builder builder()
      Creates a builder for ImmutableDecisionRecordValue.
       ImmutableDecisionRecordValue.builder()
          .withDecisionId(String | null) // nullable decisionId
          .withDecisionName(String | null) // nullable decisionName
          .withVersion(int) // optional version
          .withDecisionKey(long) // optional decisionKey
          .withDecisionRequirementsId(String | null) // nullable decisionRequirementsId
          .withDecisionRequirementsKey(long) // optional decisionRequirementsKey
          .withDuplicate(boolean) // optional duplicate
          .build();
       
      Returns:
      A new ImmutableDecisionRecordValue builder