Class ImmutableMessageRecordValue.Builder

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

@NotThreadSafe public static final class ImmutableMessageRecordValue.Builder extends Object
Builds instances of type ImmutableMessageRecordValue. 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 io.camunda.zeebe.protocol.record.value.MessageRecordValue 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 ImmutableMessageRecordValue.Builder putVariable(@Nullable String key, @Nullable 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 ImmutableMessageRecordValue.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 ImmutableMessageRecordValue.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 ImmutableMessageRecordValue.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
    • withName

      public final ImmutableMessageRecordValue.Builder withName(String name)
      Initializes the value for the name attribute.
      Parameters:
      name - The value for name (can be null)
      Returns:
      this builder for use in a chained invocation
    • withCorrelationKey

      public final ImmutableMessageRecordValue.Builder withCorrelationKey(String correlationKey)
      Initializes the value for the correlationKey attribute.
      Parameters:
      correlationKey - The value for correlationKey (can be null)
      Returns:
      this builder for use in a chained invocation
    • withMessageId

      public final ImmutableMessageRecordValue.Builder withMessageId(String messageId)
      Initializes the value for the messageId attribute.
      Parameters:
      messageId - The value for messageId (can be null)
      Returns:
      this builder for use in a chained invocation
    • withTimeToLive

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

      public final ImmutableMessageRecordValue.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
    • clear

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

      Returns:
      An immutable instance of MessageRecordValue
      Throws:
      IllegalStateException - if any required attributes are missing