Class ImmutableMessageRecordValue.Builder
java.lang.Object
io.camunda.zeebe.protocol.record.value.ImmutableMessageRecordValue.Builder
- Enclosing class:
- ImmutableMessageRecordValue
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 Summary
Modifier and TypeMethodDescriptionbuild()Builds a newImmutableMessageRecordValue.clear()Clear the builder to the initial state.from(RecordValueWithVariables instance) Fill a builder with attribute values from the providedio.camunda.zeebe.protocol.record.RecordValueWithVariablesinstance.from(MessageRecordValue instance) Fill a builder with attribute values from the providedio.camunda.zeebe.protocol.record.value.MessageRecordValueinstance.putAllVariables(Map<String, ? extends Object> entries) Put all mappings from the specified map as entries tovariablesmap.putVariable(String key, Object value) Put one entry to thevariablesmap.putVariable(Map.Entry<String, ? extends Object> entry) Put one entry to thevariablesmap.withCorrelationKey(String correlationKey) Initializes the value for thecorrelationKeyattribute.withDeadline(long deadline) Initializes the value for thedeadlineattribute.withMessageId(String messageId) Initializes the value for themessageIdattribute.Initializes the value for thenameattribute.withTimeToLive(long timeToLive) Initializes the value for thetimeToLiveattribute.withVariables(Map<String, ? extends Object> entries) Sets or replaces all mappings from the specified map as entries for thevariablesmap.
-
Method Details
-
from
Fill a builder with attribute values from the providedio.camunda.zeebe.protocol.record.value.MessageRecordValueinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
Fill a builder with attribute values from the providedio.camunda.zeebe.protocol.record.RecordValueWithVariablesinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
putVariable
public final ImmutableMessageRecordValue.Builder putVariable(@Nullable String key, @Nullable Object value) Put one entry to thevariablesmap.- Parameters:
key- The key in the variables mapvalue- The associated value in the variables map- Returns:
thisbuilder for use in a chained invocation
-
putVariable
public final ImmutableMessageRecordValue.Builder putVariable(Map.Entry<String, ? extends Object> entry) Put one entry to thevariablesmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder 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 thevariablesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the variables map- Returns:
thisbuilder 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 tovariablesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the variables map- Returns:
thisbuilder for use in a chained invocation
-
withName
Initializes the value for thenameattribute.- Parameters:
name- The value for name (can benull)- Returns:
thisbuilder for use in a chained invocation
-
withCorrelationKey
Initializes the value for thecorrelationKeyattribute.- Parameters:
correlationKey- The value for correlationKey (can benull)- Returns:
thisbuilder for use in a chained invocation
-
withMessageId
Initializes the value for themessageIdattribute.- Parameters:
messageId- The value for messageId (can benull)- Returns:
thisbuilder for use in a chained invocation
-
withTimeToLive
Initializes the value for thetimeToLiveattribute.- Parameters:
timeToLive- The value for timeToLive- Returns:
thisbuilder for use in a chained invocation
-
withDeadline
Initializes the value for thedeadlineattribute.- Parameters:
deadline- The value for deadline- Returns:
thisbuilder for use in a chained invocation
-
clear
Clear the builder to the initial state.- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableMessageRecordValue.- Returns:
- An immutable instance of MessageRecordValue
- Throws:
IllegalStateException- if any required attributes are missing
-