Class ImmutableIncidentRecordValue

java.lang.Object
io.camunda.zeebe.protocol.record.value.ImmutableIncidentRecordValue
All Implemented Interfaces:
JsonSerializable, RecordValue, IncidentRecordValue, ProcessInstanceRelated

@ParametersAreNonnullByDefault @Immutable public final class ImmutableIncidentRecordValue extends Object implements IncidentRecordValue
Immutable implementation of IncidentRecordValue.

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

  • Method Details

    • getErrorType

      public ErrorType getErrorType()
      Specified by:
      getErrorType in interface IncidentRecordValue
      Returns:
      the type of error this incident is caused by. Can be UNKNOWN if the incident record is part of a IncidentIntent#RESOLVE command.
    • getErrorMessage

      public String getErrorMessage()
      Specified by:
      getErrorMessage in interface IncidentRecordValue
      Returns:
      the description of the error this incident is caused by. Can be empty if the incident record is part of a IncidentIntent#RESOLVE command.
    • getBpmnProcessId

      public String getBpmnProcessId()
      Specified by:
      getBpmnProcessId in interface IncidentRecordValue
      Returns:
      the BPMN process id this incident belongs to. Can be empty if the incident record is part of a IncidentIntent#RESOLVE command.
    • getProcessDefinitionKey

      public long getProcessDefinitionKey()
      Specified by:
      getProcessDefinitionKey in interface IncidentRecordValue
      Returns:
      the key of the process this incident belongs to. Can be -1 if the incident record is part of a IncidentIntent#RESOLVE command.
    • getProcessInstanceKey

      public long getProcessInstanceKey()
      Specified by:
      getProcessInstanceKey in interface IncidentRecordValue
      Specified by:
      getProcessInstanceKey in interface ProcessInstanceRelated
      Returns:
      the key of the process instance this incident belongs to. Can be -1 if the incident record is part of a IncidentIntent#RESOLVE command.
    • getElementId

      public String getElementId()
      Specified by:
      getElementId in interface IncidentRecordValue
      Returns:
      the id of the element this incident belongs to. Can be empty if incident record is part of a IncidentIntent#RESOLVE command.
    • getElementInstanceKey

      public long getElementInstanceKey()
      Specified by:
      getElementInstanceKey in interface IncidentRecordValue
      Returns:
      the key of the element instance this incident belongs to. Can be -1 if the incident record is part of a IncidentIntent#RESOLVE command.
    • getJobKey

      public long getJobKey()
      Specified by:
      getJobKey in interface IncidentRecordValue
      Returns:
      the key of the job this incident belongs to. Can be -1 if the incident belongs to no job or the incident record is part of a IncidentIntent#RESOLVE command.
    • getVariableScopeKey

      public long getVariableScopeKey()
      Specified by:
      getVariableScopeKey in interface IncidentRecordValue
      Returns:
      the key of the variable scope on which the variables need to be updated. Can be -1 if the incident record is part of a IncidentIntent#RESOLVE command.
    • withErrorType

      public final ImmutableIncidentRecordValue withErrorType(ErrorType value)
      Copy the current immutable object by setting a value for the errorType attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for errorType (can be null)
      Returns:
      A modified copy of the this object
    • withErrorMessage

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

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

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

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

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

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

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

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

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableIncidentRecordValue 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: errorType, errorMessage, bpmnProcessId, processDefinitionKey, processInstanceKey, elementId, elementInstanceKey, jobKey, variableScopeKey.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableIncidentRecordValue.Builder builder()
      Creates a builder for ImmutableIncidentRecordValue.
       ImmutableIncidentRecordValue.builder()
          .withErrorType(io.camunda.zeebe.protocol.record.value.ErrorType | null) // nullable errorType
          .withErrorMessage(String | null) // nullable errorMessage
          .withBpmnProcessId(String | null) // nullable bpmnProcessId
          .withProcessDefinitionKey(long) // optional processDefinitionKey
          .withProcessInstanceKey(long) // optional processInstanceKey
          .withElementId(String | null) // nullable elementId
          .withElementInstanceKey(long) // optional elementInstanceKey
          .withJobKey(long) // optional jobKey
          .withVariableScopeKey(long) // optional variableScopeKey
          .build();
       
      Returns:
      A new ImmutableIncidentRecordValue builder