Class ImmutableJobRecordValue.Builder

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

public static final class ImmutableJobRecordValue.Builder extends Object
Builds instances of type ImmutableJobRecordValue. 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

      public final ImmutableJobRecordValue.Builder from(JobRecordValue instance)
      Fill a builder with attribute values from the provided io.camunda.zeebe.protocol.record.value.JobRecordValue instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      Fill a builder with attribute values from the provided io.camunda.zeebe.protocol.record.value.ProcessInstanceRelated instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      public final ImmutableJobRecordValue.Builder from(TenantOwned instance)
      Fill a builder with attribute values from the provided io.camunda.zeebe.protocol.record.value.TenantOwned instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      Fill a builder with attribute values from the provided io.camunda.zeebe.protocol.record.RecordValueWithVariables instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • putVariable

      public final ImmutableJobRecordValue.Builder putVariable(String key, Object value)
      Put one entry to the variables map.
      Parameters:
      key - The key in the variables map
      value - The associated value in the variables map
      Returns:
      this builder for use in a chained invocation
    • putVariable

      public final ImmutableJobRecordValue.Builder putVariable(Map.Entry<String,? extends Object> entry)
      Put one entry to the variables map. Nulls are not permitted
      Parameters:
      entry - The key and value entry
      Returns:
      this builder for use in a chained invocation
    • withVariables

      public final ImmutableJobRecordValue.Builder withVariables(Map<String,? extends Object> entries)
      Sets or replaces all mappings from the specified map as entries for the variables map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the variables map
      Returns:
      this builder for use in a chained invocation
    • putAllVariables

      public final ImmutableJobRecordValue.Builder putAllVariables(Map<String,? extends Object> entries)
      Put all mappings from the specified map as entries to variables map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the variables map
      Returns:
      this builder for use in a chained invocation
    • withProcessInstanceKey

      public final ImmutableJobRecordValue.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
    • withTenantId

      public final ImmutableJobRecordValue.Builder withTenantId(String tenantId)
      Initializes the value for the tenantId attribute.
      Parameters:
      tenantId - The value for tenantId (can be null)
      Returns:
      this builder for use in a chained invocation
    • withType

      public final ImmutableJobRecordValue.Builder withType(String type)
      Initializes the value for the type attribute.
      Parameters:
      type - The value for type (can be null)
      Returns:
      this builder for use in a chained invocation
    • putCustomHeader

      public final ImmutableJobRecordValue.Builder putCustomHeader(String key, String value)
      Put one entry to the customHeaders map.
      Parameters:
      key - The key in the customHeaders map
      value - The associated value in the customHeaders map
      Returns:
      this builder for use in a chained invocation
    • putCustomHeader

      public final ImmutableJobRecordValue.Builder putCustomHeader(Map.Entry<String,? extends String> entry)
      Put one entry to the customHeaders map. Nulls are not permitted
      Parameters:
      entry - The key and value entry
      Returns:
      this builder for use in a chained invocation
    • withCustomHeaders

      public final ImmutableJobRecordValue.Builder withCustomHeaders(Map<String,? extends String> entries)
      Sets or replaces all mappings from the specified map as entries for the customHeaders map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the customHeaders map
      Returns:
      this builder for use in a chained invocation
    • putAllCustomHeaders

      public final ImmutableJobRecordValue.Builder putAllCustomHeaders(Map<String,? extends String> entries)
      Put all mappings from the specified map as entries to customHeaders map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the customHeaders map
      Returns:
      this builder for use in a chained invocation
    • withWorker

      public final ImmutableJobRecordValue.Builder withWorker(String worker)
      Initializes the value for the worker attribute.
      Parameters:
      worker - The value for worker (can be null)
      Returns:
      this builder for use in a chained invocation
    • withRetries

      public final ImmutableJobRecordValue.Builder withRetries(int retries)
      Initializes the value for the retries attribute.
      Parameters:
      retries - The value for retries
      Returns:
      this builder for use in a chained invocation
    • withRetryBackoff

      public final ImmutableJobRecordValue.Builder withRetryBackoff(long retryBackoff)
      Initializes the value for the retryBackoff attribute.
      Parameters:
      retryBackoff - The value for retryBackoff
      Returns:
      this builder for use in a chained invocation
    • withRecurringTime

      public final ImmutableJobRecordValue.Builder withRecurringTime(long recurringTime)
      Initializes the value for the recurringTime attribute.
      Parameters:
      recurringTime - The value for recurringTime
      Returns:
      this builder for use in a chained invocation
    • withDeadline

      public final ImmutableJobRecordValue.Builder withDeadline(long deadline)
      Initializes the value for the deadline attribute.
      Parameters:
      deadline - The value for deadline
      Returns:
      this builder for use in a chained invocation
    • withTimeout

      public final ImmutableJobRecordValue.Builder withTimeout(long timeout)
      Initializes the value for the timeout attribute.
      Parameters:
      timeout - The value for timeout
      Returns:
      this builder for use in a chained invocation
    • withErrorMessage

      public final ImmutableJobRecordValue.Builder withErrorMessage(String errorMessage)
      Initializes the value for the errorMessage attribute.
      Parameters:
      errorMessage - The value for errorMessage (can be null)
      Returns:
      this builder for use in a chained invocation
    • withErrorCode

      public final ImmutableJobRecordValue.Builder withErrorCode(String errorCode)
      Initializes the value for the errorCode attribute.
      Parameters:
      errorCode - The value for errorCode (can be null)
      Returns:
      this builder for use in a chained invocation
    • withElementId

      public final ImmutableJobRecordValue.Builder withElementId(String elementId)
      Initializes the value for the elementId attribute.
      Parameters:
      elementId - The value for elementId (can be null)
      Returns:
      this builder for use in a chained invocation
    • withElementInstanceKey

      public final ImmutableJobRecordValue.Builder withElementInstanceKey(long elementInstanceKey)
      Initializes the value for the elementInstanceKey attribute.
      Parameters:
      elementInstanceKey - The value for elementInstanceKey
      Returns:
      this builder for use in a chained invocation
    • withBpmnProcessId

      public final ImmutableJobRecordValue.Builder withBpmnProcessId(String bpmnProcessId)
      Initializes the value for the bpmnProcessId attribute.
      Parameters:
      bpmnProcessId - The value for bpmnProcessId (can be null)
      Returns:
      this builder for use in a chained invocation
    • withProcessDefinitionVersion

      public final ImmutableJobRecordValue.Builder withProcessDefinitionVersion(int processDefinitionVersion)
      Initializes the value for the processDefinitionVersion attribute.
      Parameters:
      processDefinitionVersion - The value for processDefinitionVersion
      Returns:
      this builder for use in a chained invocation
    • withProcessDefinitionKey

      public final ImmutableJobRecordValue.Builder withProcessDefinitionKey(long processDefinitionKey)
      Initializes the value for the processDefinitionKey attribute.
      Parameters:
      processDefinitionKey - The value for processDefinitionKey
      Returns:
      this builder for use in a chained invocation
    • withJobKind

      public final ImmutableJobRecordValue.Builder withJobKind(JobKind jobKind)
      Initializes the value for the jobKind attribute.
      Parameters:
      jobKind - The value for jobKind (can be null)
      Returns:
      this builder for use in a chained invocation
    • withJobListenerEventType

      public final ImmutableJobRecordValue.Builder withJobListenerEventType(JobListenerEventType jobListenerEventType)
      Initializes the value for the jobListenerEventType attribute.
      Parameters:
      jobListenerEventType - The value for jobListenerEventType (can be null)
      Returns:
      this builder for use in a chained invocation
    • addChangedAttribute

      public final ImmutableJobRecordValue.Builder addChangedAttribute(String element)
      Adds one element to changedAttributes set.
      Parameters:
      element - A changedAttributes element
      Returns:
      this builder for use in a chained invocation
    • addChangedAttributes

      public final ImmutableJobRecordValue.Builder addChangedAttributes(String... elements)
      Adds elements to changedAttributes set.
      Parameters:
      elements - An array of changedAttributes elements
      Returns:
      this builder for use in a chained invocation
    • withChangedAttributes

      public final ImmutableJobRecordValue.Builder withChangedAttributes(Iterable<String> elements)
      Sets or replaces all elements for changedAttributes set.
      Parameters:
      elements - An iterable of changedAttributes elements
      Returns:
      this builder for use in a chained invocation
    • addAllChangedAttributes

      public final ImmutableJobRecordValue.Builder addAllChangedAttributes(Iterable<String> elements)
      Adds elements to changedAttributes set.
      Parameters:
      elements - An iterable of changedAttributes elements
      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 ImmutableJobRecordValue build()
      Returns:
      An immutable instance of JobRecordValue
      Throws:
      IllegalStateException - if any required attributes are missing