Package ch.admin.bit.jeap.messaging.avro
Class AvroMessageBuilder<BuilderType extends AvroMessageBuilder,MessageType extends AvroMessage>
java.lang.Object
ch.admin.bit.jeap.messaging.avro.AvroMessageBuilder<BuilderType,MessageType>
- Direct Known Subclasses:
AvroCommandBuilder,AvroDomainEventBuilder
public abstract class AvroMessageBuilder<BuilderType extends AvroMessageBuilder,MessageType extends AvroMessage>
extends Object
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddCommon(MessageType message) protected voidprotected StringReturns in order of precedence: The message type version as found in the generated avro java binding The message type version returned by getSpecifiedMessageTypeVersion() null if both contain no valueprotected abstract Stringprotected StringAllows for explicitly specifying a message type version for use cases where the message type being built is not generated from the message type registry, and its version is thus unknown.protected abstract StringidempotenceId(String idempotenceId) protected static booleanisBlank(CharSequence cs) protected abstract BuilderTypeself()protected voidsetPayload(MessagePayload payload) protected voidsetProcessId(String processId) protected voidsetReferences(MessageReferences references)
-
Field Details
-
constructor
-
idempotenceId
-
-
Constructor Details
-
AvroMessageBuilder
-
-
Method Details
-
getServiceName
-
getSystemName
-
self
-
setPayload
-
setReferences
-
setProcessId
-
getSpecifiedMessageTypeVersion
Allows for explicitly specifying a message type version for use cases where the message type being built is not generated from the message type registry, and its version is thus unknown. See {getGeneratedOrSpecifiedVersion(AvroMessage)for details.- Returns:
- Message type version to use in the messageType part of the message, i.e. "1.2.3"
-
idempotenceId
-
checkMandatoryFields
protected void checkMandatoryFields() -
getGeneratedOrSpecifiedVersion
Returns in order of precedence:- The message type version as found in the generated avro java binding
- The message type version returned by getSpecifiedMessageTypeVersion()
- null if both contain no value
-
addCommon
-
isBlank
-