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 AbstractKeyMessage.Builder<M extends AbstractKeyMessage,B extends AbstractKeyMessage.Builder<M,?>> extends ESystemMessage.Builder<M,B>
AbstractKeyMessage builders.
Provides message class and subject validation.mTargetClass| Modifier | Constructor and Description |
|---|---|
protected |
Builder(Class<? extends EMessageObject> targetClass) |
| Modifier and Type | Method and Description |
|---|---|
B |
messageClass(String mc)
Sets the message class name to the given value.
|
B |
messageKey(EMessageKey key)
Sets both the message class name and subject based on
the given message key.
|
B |
messageSubject(String subject)
Sets the message subject to the given value.
|
protected void |
validate(List<String> problems)
Checks if the message class and subject are
configured.
|
subject, timestamp, timestampbuild, buildImplprotected Builder(Class<? extends EMessageObject> targetClass)
protected void validate(List<String> problems)
validate in class EMessage.Builder<M extends AbstractKeyMessage,B extends AbstractKeyMessage.Builder<M,?>>problems - list of message configuration
problems.public B messageClass(String mc)
mc - message class name.this message builder.IllegalArgumentException - if mc is null or empty.public B messageSubject(String subject)
subject - message subject.this message builder.IllegalArgumentException - if subject is null or empty.public B messageKey(EMessageKey key)
key - message key containing message class and
subject.this message builder.NullPointerException - if key is null.Copyright © 2019. All rights reserved.