public abstract class PMessageBuilder<Message extends PMessage<Message>> extends Object implements PMessageOrBuilder<Message>
| Constructor and Description |
|---|
PMessageBuilder() |
| Modifier and Type | Method and Description |
|---|---|
abstract PMessageBuilder<Message> |
addTo(int key,
Object value)
Adds a value to a set or list container.
|
PMessageBuilder<Message> |
addTo(PField<Message> field,
Object value)
Checks if a specific field is set on the builder.
|
abstract Message |
build() |
abstract PMessageBuilder<Message> |
clear(int key)
Clear the provided field value.
|
PMessageBuilder<Message> |
clear(PField<Message> field)
Clear the provided field value.
|
abstract boolean |
isModified(int key)
Checks if a specific field is modified on the builder.
|
boolean |
isModified(PField<Message> field)
Checks if a specific field is modified on the builder.
|
abstract boolean |
isSet(int key)
Checks if a specific field is set on the builder.
|
boolean |
isSet(PField<Message> field)
Checks if a specific field is set on the builder.
|
abstract PMessageBuilder<Message> |
merge(Message from)
Merges the provided message into the builder.
|
Collection<String> |
modifiedFieldNames()
Get a sorted set of field names Modified since creation of the builder.
|
Collection<PField<Message>> |
modifiedFields()
Get a Collection of F with fields Modified since creation of the builder.
|
abstract PMessageBuilder<?> |
mutator(int key)
Get the builder for the given message contained in this builder.
|
PMessageBuilder<?> |
mutator(PField<Message> field)
Get the builder for the given message contained in this builder.
|
Collection<String> |
presentFieldNames()
Get a sorted set of fields set on the builder.
|
Collection<PField<Message>> |
presentFields()
Get a Collection of F with fields set on the builder.
|
abstract PMessageBuilder<Message> |
set(int key,
Object value)
Set the provided field value.
|
PMessageBuilder<Message> |
set(PField<Message> field,
Object value)
Set the provided field value.
|
abstract boolean |
valid()
Checks if the current set data is enough to make a valid struct.
|
abstract PMessageBuilder<Message> |
validate()
Checks if the current set data is enough to make a valid struct.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdescriptor, get, get, has, has, toBuilder, toMessagepublic abstract boolean valid()
public abstract PMessageBuilder<Message> validate() throws IllegalStateException
IllegalStateException with an appropriate error
message.IllegalStateException - When the builder will not generate a
valid message model object.@Nonnull public abstract PMessageBuilder<Message> set(int key, Object value)
key - The key of the field to set.value - The value to be set.@Nonnull public PMessageBuilder<Message> set(@Nonnull PField<Message> field, Object value)
field - The field to set.value - The value to be set.public abstract boolean isSet(int key)
key - The key of the field to check.public boolean isSet(@Nonnull PField<Message> field)
field - The field to check.@Nonnull public Collection<PField<Message>> presentFields()
public Collection<String> presentFieldNames()
public abstract boolean isModified(int key)
key - The key of the field to check.public boolean isModified(@Nonnull PField<Message> field)
field - The field to check.@Nonnull public Collection<PField<Message>> modifiedFields()
public Collection<String> modifiedFieldNames()
@Nonnull public abstract PMessageBuilder<Message> addTo(int key, Object value)
key - The key of the container field to add too.value - The value to add.IllegalArgumentException - if the field is not a list or set.@Nonnull public PMessageBuilder<Message> addTo(@Nonnull PField<Message> field, Object value)
field - The container field to add too.value - The value to add.@Nonnull public abstract PMessageBuilder<Message> clear(int key)
key - The key of the field to clear.@Nonnull public PMessageBuilder<Message> clear(@Nonnull PField<Message> field)
field - The field to clear.@Nonnull public abstract PMessageBuilder<Message> merge(@Nonnull Message from)
from - The message to merge values from.@Nonnull public abstract PMessageBuilder<?> mutator(int key)
key - The field key.IllegalArgumentException - if field is not a message field.@Nonnull public PMessageBuilder<?> mutator(@Nonnull PField<Message> field)
field - The field to mutate.IllegalArgumentException - if field is not a message field.Copyright © 2015–2020 morimekta.net. All rights reserved.