Class ImmutableErrorRecordValue.Builder

java.lang.Object
io.camunda.zeebe.protocol.record.value.ImmutableErrorRecordValue.Builder
Enclosing class:
ImmutableErrorRecordValue

@NotThreadSafe public static final class ImmutableErrorRecordValue.Builder extends Object
Builds instances of type ImmutableErrorRecordValue. Initialize attributes and then invoke the build() method to create an immutable instance.

Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

  • Method Details

    • from

      Fill a builder with attribute values from the provided ErrorRecordValue instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • withExceptionMessage

      public final ImmutableErrorRecordValue.Builder withExceptionMessage(String exceptionMessage)
      Initializes the value for the exceptionMessage attribute.
      Parameters:
      exceptionMessage - The value for exceptionMessage (can be null)
      Returns:
      this builder for use in a chained invocation
    • withStacktrace

      public final ImmutableErrorRecordValue.Builder withStacktrace(String stacktrace)
      Initializes the value for the stacktrace attribute.
      Parameters:
      stacktrace - The value for stacktrace (can be null)
      Returns:
      this builder for use in a chained invocation
    • withErrorEventPosition

      public final ImmutableErrorRecordValue.Builder withErrorEventPosition(long errorEventPosition)
      Initializes the value for the errorEventPosition attribute.
      Parameters:
      errorEventPosition - The value for errorEventPosition
      Returns:
      this builder for use in a chained invocation
    • withProcessInstanceKey

      public final ImmutableErrorRecordValue.Builder withProcessInstanceKey(long processInstanceKey)
      Initializes the value for the processInstanceKey attribute.
      Parameters:
      processInstanceKey - The value for processInstanceKey
      Returns:
      this builder for use in a chained invocation
    • clear

      Clear the builder to the initial state.
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutableErrorRecordValue build()
      Returns:
      An immutable instance of ErrorRecordValue
      Throws:
      IllegalStateException - if any required attributes are missing