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 pmodel.MessageType builder instance._Builder(MessageType base)Make a mutating builder off a base pmodel.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 thefieldslist.MessageTypebuild()MessageType._Builderclear(int key)MessageType._BuilderclearAnnotations()Clear theannotationsfield.MessageType._BuilderclearDocumentation()Clear thedocumentationfield.MessageType._BuilderclearEndPos()Clear theend_posfield.MessageType._BuilderclearFields()Clear thefieldsfield.MessageType._BuilderclearName()Clear thenamefield.MessageType._BuilderclearStartPos()Clear thestart_posfield.MessageType._BuilderclearVariant()Clear thevariantfield.net.morimekta.providence.descriptor.PStructDescriptor<MessageType,MessageType._Field>descriptor()booleanequals(java.lang.Object o)java.lang.StringgetDocumentation()FilePosgetEndPos()The end of the definition (position of '}')java.lang.StringgetName()FilePosgetStartPos()The start of the definition (position of 'struct' / message type)MessageVariantgetVariant()inthashCode()booleanisModified(int key)booleanisModifiedAnnotations()Checks if theannotationsfield has been modified since the builder was created.booleanisModifiedDocumentation()Checks if thedocumentationfield has been modified since the builder was created.booleanisModifiedEndPos()Checks if theend_posfield has been modified since the builder was created.booleanisModifiedFields()Checks if thefieldsfield has been modified since the builder was created.booleanisModifiedName()Checks if thenamefield has been modified since the builder was created.booleanisModifiedStartPos()Checks if thestart_posfield has been modified since the builder was created.booleanisModifiedVariant()Checks if thevariantfield has been modified since the builder was created.booleanisSet(int key)booleanisSetAnnotations()Checks for presence of theannotationsfield.booleanisSetDocumentation()Checks for presence of thedocumentationfield.booleanisSetEndPos()Checks for presence of theend_posfield.booleanisSetFields()Checks for presence of thefieldsfield.booleanisSetName()Checks for presence of thenamefield.booleanisSetStartPos()Checks for presence of thestart_posfield.booleanisSetVariant()Checks for presence of thevariantfield.MessageType._Buildermerge(MessageType from)java.util.Map<java.lang.String,java.lang.String>mutableAnnotations()Get the builder for the containedannotationsmessage field.FilePos._BuildermutableEndPos()Get the builder for the containedend_posmessage field.java.util.List<FieldType>mutableFields()Get the builder for the containedfieldsmessage field.FilePos._BuildermutableStartPos()Get the builder for the containedstart_posmessage field.net.morimekta.providence.PMessageBuildermutator(int key)MessageType._BuilderputInAnnotations(java.lang.String key, java.lang.String value)Adds a mapping to theannotationsmap.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)Set theannotationsfield value.MessageType._BuildersetDocumentation(java.lang.String value)Set thedocumentationfield value.MessageType._BuildersetEndPos(FilePos value)Set theend_posfield value.MessageType._BuildersetEndPos(FilePos._Builder builder)Set theend_posfield value.MessageType._BuildersetFields(java.util.Collection<FieldType> value)Set thefieldsfield value.MessageType._BuildersetName(java.lang.String value)Set thenamefield value.MessageType._BuildersetStartPos(FilePos value)Set thestart_posfield value.MessageType._BuildersetStartPos(FilePos._Builder builder)Set thestart_posfield value.MessageType._BuildersetVariant(MessageVariant value)Set thevariantfield value.booleanvalid()voidvalidate()
-
-
-
Constructor Detail
-
_Builder
public _Builder()
Make a pmodel.MessageType builder instance.
-
_Builder
public _Builder(MessageType base)
Make a mutating builder off a base pmodel.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)
Set thedocumentationfield value.- Parameters:
value- The new value- Returns:
- The builder
-
isSetDocumentation
public boolean isSetDocumentation()
Checks for presence of thedocumentationfield.- Returns:
- True if documentation has been set.
-
isModifiedDocumentation
public boolean isModifiedDocumentation()
Checks if thedocumentationfield has been modified since the builder was created.- Returns:
- True if documentation has been modified.
-
clearDocumentation
@Nonnull public MessageType._Builder clearDocumentation()
Clear thedocumentationfield.- Returns:
- The builder
-
getDocumentation
public java.lang.String getDocumentation()
- Returns:
- The
documentationfield value
-
setVariant
@Nonnull public MessageType._Builder setVariant(MessageVariant value)
Set thevariantfield value.- Parameters:
value- The new value- Returns:
- The builder
-
isSetVariant
public boolean isSetVariant()
Checks for presence of thevariantfield.- Returns:
- True if variant has been set.
-
isModifiedVariant
public boolean isModifiedVariant()
Checks if thevariantfield has been modified since the builder was created.- Returns:
- True if variant has been modified.
-
clearVariant
@Nonnull public MessageType._Builder clearVariant()
Clear thevariantfield.- Returns:
- The builder
-
getVariant
public MessageVariant getVariant()
- Returns:
- The
variantfield value
-
setName
@Nonnull public MessageType._Builder setName(java.lang.String value)
Set thenamefield value.- Parameters:
value- The new value- Returns:
- The builder
-
isSetName
public boolean isSetName()
Checks for presence of thenamefield.- Returns:
- True if name has been set.
-
isModifiedName
public boolean isModifiedName()
Checks if thenamefield has been modified since the builder was created.- Returns:
- True if name has been modified.
-
clearName
@Nonnull public MessageType._Builder clearName()
Clear thenamefield.- Returns:
- The builder
-
getName
public java.lang.String getName()
- Returns:
- The
namefield value
-
setFields
@Nonnull public MessageType._Builder setFields(java.util.Collection<FieldType> value)
Set thefieldsfield value.- Parameters:
value- The new value- Returns:
- The builder
-
addToFields
@Nonnull public MessageType._Builder addToFields(FieldType... values)
Adds entries to thefieldslist.- Parameters:
values- The added value- Returns:
- The builder
-
isSetFields
public boolean isSetFields()
Checks for presence of thefieldsfield.- Returns:
- True if fields has been set.
-
isModifiedFields
public boolean isModifiedFields()
Checks if thefieldsfield has been modified since the builder was created.- Returns:
- True if fields has been modified.
-
clearFields
@Nonnull public MessageType._Builder clearFields()
Clear thefieldsfield.- Returns:
- The builder
-
mutableFields
@Nonnull public java.util.List<FieldType> mutableFields()
Get the builder for the containedfieldsmessage field.- Returns:
- The field message builder
-
setAnnotations
@Nonnull public MessageType._Builder setAnnotations(java.util.Map<java.lang.String,java.lang.String> value)
Set theannotationsfield value.- 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 theannotationsmap.- Parameters:
key- The inserted keyvalue- The inserted value- Returns:
- The builder
-
isSetAnnotations
public boolean isSetAnnotations()
Checks for presence of theannotationsfield.- Returns:
- True if annotations has been set.
-
isModifiedAnnotations
public boolean isModifiedAnnotations()
Checks if theannotationsfield has been modified since the builder was created.- Returns:
- True if annotations has been modified.
-
clearAnnotations
@Nonnull public MessageType._Builder clearAnnotations()
Clear theannotationsfield.- Returns:
- The builder
-
mutableAnnotations
@Nonnull public java.util.Map<java.lang.String,java.lang.String> mutableAnnotations()
Get the builder for the containedannotationsmessage field.- Returns:
- The field message builder
-
setStartPos
@Nonnull public MessageType._Builder setStartPos(FilePos value)
Set thestart_posfield value.The start of the definition (position of 'struct' / message type)
- Parameters:
value- The new value- Returns:
- The builder
-
setStartPos
@Nonnull public MessageType._Builder setStartPos(FilePos._Builder builder)
Set thestart_posfield value.The start of the definition (position of 'struct' / message type)
- Parameters:
builder- builder for the new value- Returns:
- The builder
-
isSetStartPos
public boolean isSetStartPos()
Checks for presence of thestart_posfield.- Returns:
- True if start_pos has been set.
-
isModifiedStartPos
public boolean isModifiedStartPos()
Checks if thestart_posfield has been modified since the builder was created.- Returns:
- True if start_pos has been modified.
-
clearStartPos
@Nonnull public MessageType._Builder clearStartPos()
Clear thestart_posfield.- Returns:
- The builder
-
mutableStartPos
@Nonnull public FilePos._Builder mutableStartPos()
Get the builder for the containedstart_posmessage field.The start of the definition (position of 'struct' / message type)
- Returns:
- The field message builder
-
getStartPos
public FilePos getStartPos()
The start of the definition (position of 'struct' / message type)- Returns:
- The field value
-
setEndPos
@Nonnull public MessageType._Builder setEndPos(FilePos value)
Set theend_posfield value.The end of the definition (position of '}')
- Parameters:
value- The new value- Returns:
- The builder
-
setEndPos
@Nonnull public MessageType._Builder setEndPos(FilePos._Builder builder)
Set theend_posfield value.The end of the definition (position of '}')
- Parameters:
builder- builder for the new value- Returns:
- The builder
-
isSetEndPos
public boolean isSetEndPos()
Checks for presence of theend_posfield.- Returns:
- True if end_pos has been set.
-
isModifiedEndPos
public boolean isModifiedEndPos()
Checks if theend_posfield has been modified since the builder was created.- Returns:
- True if end_pos has been modified.
-
clearEndPos
@Nonnull public MessageType._Builder clearEndPos()
Clear theend_posfield.- Returns:
- The builder
-
mutableEndPos
@Nonnull public FilePos._Builder mutableEndPos()
Get the builder for the containedend_posmessage field.The end of the definition (position of '}')
- Returns:
- The field message builder
-
getEndPos
public FilePos getEndPos()
The end of the definition (position of '}')- Returns:
- The field value
-
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
@Nonnull 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>
-
-