Package net.morimekta.providence.model
Class MessageType._Builder
- java.lang.Object
-
- net.morimekta.providence.PMessageBuilder<MessageType,MessageType._Field>
-
- net.morimekta.providence.model.MessageType._Builder
-
- All Implemented Interfaces:
net.morimekta.providence.PBuilder<MessageType>,net.morimekta.providence.serializer.binary.BinaryReader
- Enclosing class:
- MessageType
public static class MessageType._Builder extends net.morimekta.providence.PMessageBuilder<MessageType,MessageType._Field> implements net.morimekta.providence.serializer.binary.BinaryReader
<variant> { (<field> ([,;])?)* }
-
-
Constructor Summary
Constructors Constructor Description _Builder()Make a providence_model.MessageType builder._Builder(MessageType base)Make a mutating builder off a base providence_model.MessageType.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MessageType._BuilderaddTo(int key, java.lang.Object value)MessageType._BuilderaddToFields(FieldType... values)Adds entries to fields.MessageTypebuild()MessageType._Builderclear(int key)MessageType._BuilderclearAnnotations()Clears the annotations field.MessageType._BuilderclearDocumentation()Clears the documentation field.MessageType._BuilderclearFields()Clears the fields field.MessageType._BuilderclearName()Clears the name field.MessageType._BuilderclearVariant()Clears the variant field.net.morimekta.providence.descriptor.PStructDescriptor<MessageType,MessageType._Field>descriptor()booleanequals(java.lang.Object o)java.lang.StringgetDocumentation()Gets the value of the contained documentation.java.lang.StringgetName()Gets the value of the contained name.MessageVariantgetVariant()Gets the value of the contained variant.inthashCode()booleanisModified(int key)booleanisModifiedAnnotations()Checks if annotations has been modified since the _Builder was created.booleanisModifiedDocumentation()Checks if documentation has been modified since the _Builder was created.booleanisModifiedFields()Checks if fields has been modified since the _Builder was created.booleanisModifiedName()Checks if name has been modified since the _Builder was created.booleanisModifiedVariant()Checks if variant has been modified since the _Builder was created.booleanisSet(int key)booleanisSetAnnotations()Checks for presence of the annotations field.booleanisSetDocumentation()Checks for presence of the documentation field.booleanisSetFields()Checks for presence of the fields field.booleanisSetName()Checks for presence of the name field.booleanisSetVariant()Checks for presence of the variant field.MessageType._Buildermerge(MessageType from)java.util.Map<java.lang.String,java.lang.String>mutableAnnotations()Gets the builder for the contained annotations.java.util.List<FieldType>mutableFields()Gets the builder for the contained fields.net.morimekta.providence.PMessageBuildermutator(int key)MessageType._BuilderputInAnnotations(java.lang.String key, java.lang.String value)Adds a mapping to annotations.voidreadBinary(net.morimekta.util.io.BigEndianBinaryReader reader, boolean strict)MessageType._Builderset(int key, java.lang.Object value)MessageType._BuildersetAnnotations(java.util.Map<java.lang.String,java.lang.String> value)Sets the value of annotations.MessageType._BuildersetDocumentation(java.lang.String value)Sets the value of documentation.MessageType._BuildersetFields(java.util.Collection<FieldType> value)Sets the value of fields.MessageType._BuildersetName(java.lang.String value)Sets the value of name.MessageType._BuildersetVariant(MessageVariant value)Sets the value of variant.booleanvalid()voidvalidate()
-
-
-
Constructor Detail
-
_Builder
public _Builder()
Make a providence_model.MessageType builder.
-
_Builder
public _Builder(MessageType base)
Make a mutating builder off a base providence_model.MessageType.- Parameters:
base- The base MessageType
-
-
Method Detail
-
merge
@Nonnull public MessageType._Builder merge(MessageType from)
- Specified by:
mergein classnet.morimekta.providence.PMessageBuilder<MessageType,MessageType._Field>
-
setDocumentation
@Nonnull public MessageType._Builder setDocumentation(java.lang.String value)
Sets the value of documentation.- Parameters:
value- The new value- Returns:
- The builder
-
isSetDocumentation
public boolean isSetDocumentation()
Checks for presence of the documentation field.- Returns:
- True if documentation has been set.
-
isModifiedDocumentation
public boolean isModifiedDocumentation()
Checks if documentation has been modified since the _Builder was created.- Returns:
- True if documentation has been modified.
-
clearDocumentation
@Nonnull public MessageType._Builder clearDocumentation()
Clears the documentation field.- Returns:
- The builder
-
getDocumentation
public java.lang.String getDocumentation()
Gets the value of the contained documentation.- Returns:
- The field value
-
setVariant
@Nonnull public MessageType._Builder setVariant(MessageVariant value)
Sets the value of variant.- Parameters:
value- The new value- Returns:
- The builder
-
isSetVariant
public boolean isSetVariant()
Checks for presence of the variant field.- Returns:
- True if variant has been set.
-
isModifiedVariant
public boolean isModifiedVariant()
Checks if variant has been modified since the _Builder was created.- Returns:
- True if variant has been modified.
-
clearVariant
@Nonnull public MessageType._Builder clearVariant()
Clears the variant field.- Returns:
- The builder
-
getVariant
public MessageVariant getVariant()
Gets the value of the contained variant.- Returns:
- The field value
-
setName
@Nonnull public MessageType._Builder setName(java.lang.String value)
Sets the value of name.- Parameters:
value- The new value- Returns:
- The builder
-
isSetName
public boolean isSetName()
Checks for presence of the name field.- Returns:
- True if name has been set.
-
isModifiedName
public boolean isModifiedName()
Checks if name has been modified since the _Builder was created.- Returns:
- True if name has been modified.
-
clearName
@Nonnull public MessageType._Builder clearName()
Clears the name field.- Returns:
- The builder
-
getName
public java.lang.String getName()
Gets the value of the contained name.- Returns:
- The field value
-
setFields
@Nonnull public MessageType._Builder setFields(java.util.Collection<FieldType> value)
Sets the value of fields.- Parameters:
value- The new value- Returns:
- The builder
-
addToFields
@Nonnull public MessageType._Builder addToFields(FieldType... values)
Adds entries to fields.- Parameters:
values- The added value- Returns:
- The builder
-
isSetFields
public boolean isSetFields()
Checks for presence of the fields field.- Returns:
- True if fields has been set.
-
isModifiedFields
public boolean isModifiedFields()
Checks if fields has been modified since the _Builder was created.- Returns:
- True if fields has been modified.
-
clearFields
@Nonnull public MessageType._Builder clearFields()
Clears the fields field.- Returns:
- The builder
-
mutableFields
@Nonnull public java.util.List<FieldType> mutableFields()
Gets the builder for the contained fields.- Returns:
- The field builder
-
setAnnotations
@Nonnull public MessageType._Builder setAnnotations(java.util.Map<java.lang.String,java.lang.String> value)
Sets the value of annotations.- Parameters:
value- The new value- Returns:
- The builder
-
putInAnnotations
@Nonnull public MessageType._Builder putInAnnotations(java.lang.String key, java.lang.String value)
Adds a mapping to annotations.- Parameters:
key- The inserted keyvalue- The inserted value- Returns:
- The builder
-
isSetAnnotations
public boolean isSetAnnotations()
Checks for presence of the annotations field.- Returns:
- True if annotations has been set.
-
isModifiedAnnotations
public boolean isModifiedAnnotations()
Checks if annotations has been modified since the _Builder was created.- Returns:
- True if annotations has been modified.
-
clearAnnotations
@Nonnull public MessageType._Builder clearAnnotations()
Clears the annotations field.- Returns:
- The builder
-
mutableAnnotations
@Nonnull public java.util.Map<java.lang.String,java.lang.String> mutableAnnotations()
Gets the builder for the contained annotations.- Returns:
- The field builder
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
mutator
public net.morimekta.providence.PMessageBuilder mutator(int key)
- Specified by:
mutatorin classnet.morimekta.providence.PMessageBuilder<MessageType,MessageType._Field>
-
set
@Nonnull public MessageType._Builder set(int key, java.lang.Object value)
- Specified by:
setin classnet.morimekta.providence.PMessageBuilder<MessageType,MessageType._Field>
-
isSet
public boolean isSet(int key)
- Specified by:
isSetin classnet.morimekta.providence.PMessageBuilder<MessageType,MessageType._Field>
-
isModified
public boolean isModified(int key)
- Specified by:
isModifiedin classnet.morimekta.providence.PMessageBuilder<MessageType,MessageType._Field>
-
addTo
public MessageType._Builder addTo(int key, java.lang.Object value)
- Specified by:
addToin classnet.morimekta.providence.PMessageBuilder<MessageType,MessageType._Field>
-
clear
@Nonnull public MessageType._Builder clear(int key)
- Specified by:
clearin classnet.morimekta.providence.PMessageBuilder<MessageType,MessageType._Field>
-
valid
public boolean valid()
- Specified by:
validin classnet.morimekta.providence.PMessageBuilder<MessageType,MessageType._Field>
-
validate
public void validate()
- Specified by:
validatein classnet.morimekta.providence.PMessageBuilder<MessageType,MessageType._Field>
-
descriptor
@Nonnull public net.morimekta.providence.descriptor.PStructDescriptor<MessageType,MessageType._Field> descriptor()
- Specified by:
descriptorin classnet.morimekta.providence.PMessageBuilder<MessageType,MessageType._Field>
-
readBinary
public void readBinary(net.morimekta.util.io.BigEndianBinaryReader reader, boolean strict) throws java.io.IOException- Specified by:
readBinaryin interfacenet.morimekta.providence.serializer.binary.BinaryReader- Throws:
java.io.IOException
-
build
public MessageType build()
- Specified by:
buildin interfacenet.morimekta.providence.PBuilder<MessageType>
-
-