M - builds this target message class.B - message builder subclass. Needed to return the
correct builder type when setting fields. If this were not
the case, field chaining would not work.public abstract static class EReplyMessage.Builder<M extends EReplyMessage,B extends EReplyMessage.Builder<M,?>> extends EMessage.Builder<M,B>
EReplyMessage builders. Used by
eBus when de-serializing an encoded message back into the
target message object.| Modifier and Type | Field and Description |
|---|---|
protected String |
mReplyReason
Generally text explaining a error status.
|
protected EReplyMessage.ReplyStatus |
mReplyStatus
Reply is either OK but continuing, OK and final, and
error (which is always final).
|
mTargetClass| Modifier | Constructor and Description |
|---|---|
protected |
Builder(Class<? extends EMessageObject> targetClass) |
| Modifier and Type | Method and Description |
|---|---|
B |
replyReason(String reason)
Sets the reply status reason.
|
B |
replyStatus(EReplyMessage.ReplyStatus status)
Sets the replier status for the matching request.
|
protected void |
validate(List<String> problems)
Checks if message subject and message type are
configured.
|
subject, timestamp, timestampbuild, buildImpl@Nonnull protected EReplyMessage.ReplyStatus mReplyStatus
protected Builder(Class<? extends EMessageObject> targetClass)
protected void validate(List<String> problems)
EMessage.Builderproblems.
This method should be overridden by subclass message
builders and called before doing its own
validation. The first line in the subclass
validate implementation should be
super.validate(problems);.
When overriding this method, be sure to add all
discovered validation problems to the list. The
validation method should consist of a series of
individual if statements and not
an if/else if chain. That way all problems
are found and not just the first one.
validate in class EMessage.Builder<M extends EReplyMessage,B extends EReplyMessage.Builder<M,?>>problems - append validation problems to this
list.public final B replyStatus(EReplyMessage.ReplyStatus status)
status - replier status.this builder instance.NullPointerException - if status is null.Copyright © 2019. All rights reserved.