Class ImmutableErrorRecordValue
java.lang.Object
io.camunda.zeebe.protocol.record.value.ImmutableErrorRecordValue
- All Implemented Interfaces:
JsonSerializable,RecordValue,ErrorRecordValue
Immutable implementation of
ErrorRecordValue.
Use the builder to create immutable instances:
ImmutableErrorRecordValue.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableErrorRecordValue. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableErrorRecordValue.static ImmutableErrorRecordValuecopyOf(ErrorRecordValue instance) Creates an immutable copy of aErrorRecordValuevalue.booleanThis instance is equal to all instances ofImmutableErrorRecordValuethat have equal attribute values.longlonginthashCode()Returns a lazily computed hash code from attributes:exceptionMessage,stacktrace,errorEventPosition,processInstanceKey.toString()Prints the immutable valueErrorRecordValuewith attribute values.withErrorEventPosition(long value) Copy the current immutable object by setting a value for theerrorEventPositionattribute.withExceptionMessage(String value) Copy the current immutable object by setting a value for theexceptionMessageattribute.withProcessInstanceKey(long value) Copy the current immutable object by setting a value for theprocessInstanceKeyattribute.withStacktrace(String value) Copy the current immutable object by setting a value for thestacktraceattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.camunda.zeebe.protocol.record.JsonSerializable
toJson
-
Method Details
-
getExceptionMessage
- Specified by:
getExceptionMessagein interfaceErrorRecordValue- Returns:
- the exception message, which causes this error record.
-
getStacktrace
- Specified by:
getStacktracein interfaceErrorRecordValue- Returns:
- the stacktrace, which belongs to the exception
-
getErrorEventPosition
public long getErrorEventPosition()- Specified by:
getErrorEventPositionin interfaceErrorRecordValue- Returns:
- the position of the event, which causes this error
-
getProcessInstanceKey
public long getProcessInstanceKey()- Specified by:
getProcessInstanceKeyin interfaceErrorRecordValue- Returns:
- the process instance key, which is related to the failed event. If the event is not process instance related, then this will return -1
-
withExceptionMessage
Copy the current immutable object by setting a value for theexceptionMessageattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for exceptionMessage (can benull)- Returns:
- A modified copy of the
thisobject
-
withStacktrace
Copy the current immutable object by setting a value for thestacktraceattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for stacktrace (can benull)- Returns:
- A modified copy of the
thisobject
-
withErrorEventPosition
Copy the current immutable object by setting a value for theerrorEventPositionattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for errorEventPosition- Returns:
- A modified copy of the
thisobject
-
withProcessInstanceKey
Copy the current immutable object by setting a value for theprocessInstanceKeyattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for processInstanceKey- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableErrorRecordValuethat have equal attribute values. -
hashCode
public int hashCode()Returns a lazily computed hash code from attributes:exceptionMessage,stacktrace,errorEventPosition,processInstanceKey. -
toString
Prints the immutable valueErrorRecordValuewith attribute values. -
copyOf
Creates an immutable copy of aErrorRecordValuevalue. 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 ErrorRecordValue instance
-
builder
Creates a builder forImmutableErrorRecordValue.ImmutableErrorRecordValue.builder() .withExceptionMessage(String | null) // nullableexceptionMessage.withStacktrace(String | null) // nullablestacktrace.withErrorEventPosition(long) // optionalerrorEventPosition.withProcessInstanceKey(long) // optionalprocessInstanceKey.build();- Returns:
- A new ImmutableErrorRecordValue builder
-