Package net.morimekta.providence.model
Class MessageType._Builder
- java.lang.Object
-
- net.morimekta.providence.PMessageBuilder<MessageType>
-
- net.morimekta.providence.model.MessageType._Builder
-
- All Implemented Interfaces:
Decl,Decl._Builder,MessageType_OrBuilder,net.morimekta.providence.PBuilder<MessageType>,net.morimekta.providence.PMessageOrBuilder<MessageType>,net.morimekta.providence.PValue<MessageType>,net.morimekta.providence.serializer.binary.BinaryReader
- Enclosing class:
- MessageType
public static class MessageType._Builder extends net.morimekta.providence.PMessageBuilder<MessageType> implements Decl._Builder, MessageType_OrBuilder, net.morimekta.providence.serializer.binary.BinaryReader
<variant> { (<field> ([,;])?)* }
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.morimekta.providence.model.Decl
Decl._Builder, Decl._Field
-
-
Field Summary
-
Fields inherited from interface net.morimekta.providence.model.Decl
kDescriptor
-
-
Constructor Summary
Constructors Constructor Description _Builder()Make a p_model.MessageType builder instance._Builder(MessageType base)Make a mutating builder off a base p_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 thefieldslist.MessageTypebuild()MessageType._Builderclear(int key)MessageType._BuilderclearAnnotations()Clear theannotationsfield.MessageType._BuilderclearDocumentation()Clear thedocumentationfield.MessageType._BuilderclearFields()Clear thefieldsfield.MessageType._BuilderclearImplementing()Clear theimplementingfield.MessageType._BuilderclearName()Clear thenamefield.MessageType._BuilderclearVariant()Clear thevariantfield.net.morimekta.providence.descriptor.PStructDescriptor<MessageType>descriptor()booleanequals(java.lang.Object o)<T> Tget(int key)java.util.Map<java.lang.String,java.lang.String>getAnnotations()java.lang.StringgetDocumentation()Documentation for the specific declaration.java.util.List<FieldType>getFields()java.lang.StringgetImplementing()Interface this message is implementing.java.lang.StringgetName()Name of the type, constant or service.MessageVariantgetVariant()booleanhas(int key)booleanhasAnnotations()Checks for presence of theannotationsfield.booleanhasDocumentation()Checks for presence of thedocumentationfield.booleanhasFields()Checks for presence of thefieldsfield.inthashCode()booleanhasImplementing()Checks for presence of theimplementingfield.booleanhasName()Checks for presence of thenamefield.booleanhasVariant()Checks for presence of thevariantfield.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.booleanisModifiedFields()Checks if thefieldsfield has been modified since the builder was created.booleanisModifiedImplementing()Checks if theimplementingfield has been modified since the builder was created.booleanisModifiedName()Checks if thenamefield 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 explicit presence of theannotationsfield.booleanisSetDocumentation()Checks for explicit presence of thedocumentationfield.booleanisSetFields()Checks for explicit presence of thefieldsfield.booleanisSetImplementing()Checks for explicit presence of theimplementingfield.booleanisSetName()Checks for explicit presence of thenamefield.booleanisSetVariant()Checks for explicit presence of thevariantfield.MessageType._Buildermerge(MessageType from)java.util.Map<java.lang.String,java.lang.String>mutableAnnotations()java.util.List<FieldType>mutableFields()net.morimekta.providence.PMessageBuildermutator(int key)intnumAnnotations()intnumFields()java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>optionalAnnotations()java.util.Optional<java.lang.String>optionalDocumentation()Documentation for the specific declaration.java.util.Optional<java.lang.String>optionalImplementing()Interface this message is implementing.java.util.Optional<MessageVariant>optionalVariant()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._BuildersetFields(java.util.Collection<FieldType> value)Set thefieldsfield value.MessageType._BuildersetImplementing(java.lang.String value)Set theimplementingfield value.MessageType._BuildersetName(java.lang.String value)Set thenamefield value.MessageType._BuildersetVariant(MessageVariant value)Set thevariantfield value.booleanvalid()MessageType._Buildervalidate()-
Methods inherited from class net.morimekta.providence.PMessageBuilder
addTo, clear, isModified, isSet, modifiedFields, mutator, presentFields, set
-
-
-
-
Constructor Detail
-
_Builder
public _Builder()
Make a p_model.MessageType builder instance.
-
_Builder
public _Builder(MessageType base)
Make a mutating builder off a base p_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>
-
setDocumentation
@Nonnull public MessageType._Builder setDocumentation(java.lang.String value)
Set thedocumentationfield value.- Specified by:
setDocumentationin interfaceDecl._Builder- Parameters:
value- The new value- Returns:
- The builder
-
isSetDocumentation
public boolean isSetDocumentation()
Checks for explicit presence of thedocumentationfield.- Returns:
- True if documentation has been set.
-
hasDocumentation
public boolean hasDocumentation()
Checks for presence of thedocumentationfield.- Specified by:
hasDocumentationin interfaceDecl- Returns:
- True if documentation is present.
-
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.- Specified by:
clearDocumentationin interfaceDecl._Builder- Returns:
- The builder
-
getDocumentation
public java.lang.String getDocumentation()
Description copied from interface:DeclDocumentation for the specific declaration.- Specified by:
getDocumentationin interfaceDecl- Returns:
- The
documentationfield value
-
optionalDocumentation
@Nonnull public java.util.Optional<java.lang.String> optionalDocumentation()
Description copied from interface:DeclDocumentation for the specific declaration.- Specified by:
optionalDocumentationin interfaceDecl- Returns:
- Optional
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 explicit presence of thevariantfield.- Returns:
- True if variant has been set.
-
hasVariant
public boolean hasVariant()
Checks for presence of thevariantfield.- Specified by:
hasVariantin interfaceMessageType_OrBuilder- Returns:
- True if variant is present.
-
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()
- Specified by:
getVariantin interfaceMessageType_OrBuilder- Returns:
- The
variantfield value
-
optionalVariant
@Nonnull public java.util.Optional<MessageVariant> optionalVariant()
- Specified by:
optionalVariantin interfaceMessageType_OrBuilder- Returns:
- Optional
variantfield value
-
setName
@Nonnull public MessageType._Builder setName(java.lang.String value)
Set thenamefield value.- Specified by:
setNamein interfaceDecl._Builder- Parameters:
value- The new value- Returns:
- The builder
-
isSetName
public boolean isSetName()
Checks for explicit presence of thenamefield.- Returns:
- True if name has been set.
-
hasName
public boolean hasName()
Checks for presence of thenamefield.
-
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.- Specified by:
clearNamein interfaceDecl._Builder- Returns:
- The builder
-
getName
public java.lang.String getName()
Description copied from interface:DeclName of the type, constant or service.
-
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 explicit presence of thefieldsfield.- Returns:
- True if fields has been set.
-
hasFields
public boolean hasFields()
Checks for presence of thefieldsfield.- Specified by:
hasFieldsin interfaceMessageType_OrBuilder- Returns:
- True if fields is present.
-
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
public java.util.List<FieldType> mutableFields()
- Returns:
- The mutable
fieldscontainer
-
getFields
public java.util.List<FieldType> getFields()
- Specified by:
getFieldsin interfaceMessageType_OrBuilder- Returns:
- The
fieldsfield value
-
numFields
public int numFields()
- Specified by:
numFieldsin interfaceMessageType_OrBuilder- Returns:
- Number of entries in
fields.
-
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 explicit presence of theannotationsfield.- Returns:
- True if annotations has been set.
-
hasAnnotations
public boolean hasAnnotations()
Checks for presence of theannotationsfield.- Specified by:
hasAnnotationsin interfaceMessageType_OrBuilder- Returns:
- True if annotations is present.
-
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
public java.util.Map<java.lang.String,java.lang.String> mutableAnnotations()
- Returns:
- The mutable
annotationscontainer
-
getAnnotations
public java.util.Map<java.lang.String,java.lang.String> getAnnotations()
- Specified by:
getAnnotationsin interfaceMessageType_OrBuilder- Returns:
- The
annotationsfield value
-
optionalAnnotations
@Nonnull public java.util.Optional<java.util.Map<java.lang.String,java.lang.String>> optionalAnnotations()
- Specified by:
optionalAnnotationsin interfaceMessageType_OrBuilder- Returns:
- Optional
annotationsfield value
-
numAnnotations
public int numAnnotations()
- Specified by:
numAnnotationsin interfaceMessageType_OrBuilder- Returns:
- Number of entries in
annotations.
-
setImplementing
@Nonnull public MessageType._Builder setImplementing(java.lang.String value)
Set theimplementingfield value.Interface this message is implementing.
- Parameters:
value- The new value- Returns:
- The builder
-
isSetImplementing
public boolean isSetImplementing()
Checks for explicit presence of theimplementingfield.- Returns:
- True if implementing has been set.
-
hasImplementing
public boolean hasImplementing()
Checks for presence of theimplementingfield.- Specified by:
hasImplementingin interfaceMessageType_OrBuilder- Returns:
- True if implementing is present.
-
isModifiedImplementing
public boolean isModifiedImplementing()
Checks if theimplementingfield has been modified since the builder was created.- Returns:
- True if implementing has been modified.
-
clearImplementing
@Nonnull public MessageType._Builder clearImplementing()
Clear theimplementingfield.- Returns:
- The builder
-
getImplementing
public java.lang.String getImplementing()
Interface this message is implementing.- Specified by:
getImplementingin interfaceMessageType_OrBuilder- Returns:
- The
implementingfield value
-
optionalImplementing
@Nonnull public java.util.Optional<java.lang.String> optionalImplementing()
Interface this message is implementing.- Specified by:
optionalImplementingin interfaceMessageType_OrBuilder- Returns:
- Optional
implementingfield 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>
-
set
@Nonnull public MessageType._Builder set(int key, java.lang.Object value)
- Specified by:
setin classnet.morimekta.providence.PMessageBuilder<MessageType>
-
isSet
public boolean isSet(int key)
- Specified by:
isSetin classnet.morimekta.providence.PMessageBuilder<MessageType>
-
isModified
public boolean isModified(int key)
- Specified by:
isModifiedin classnet.morimekta.providence.PMessageBuilder<MessageType>
-
get
public <T> T get(int key)
- Specified by:
getin interfacenet.morimekta.providence.PMessageOrBuilder<MessageType>
-
has
public boolean has(int key)
- Specified by:
hasin interfacenet.morimekta.providence.PMessageOrBuilder<MessageType>
-
addTo
@Nonnull public MessageType._Builder addTo(int key, java.lang.Object value)
- Specified by:
addToin classnet.morimekta.providence.PMessageBuilder<MessageType>
-
clear
@Nonnull public MessageType._Builder clear(int key)
- Specified by:
clearin classnet.morimekta.providence.PMessageBuilder<MessageType>
-
valid
public boolean valid()
- Specified by:
validin classnet.morimekta.providence.PMessageBuilder<MessageType>
-
validate
public MessageType._Builder validate()
- Specified by:
validatein classnet.morimekta.providence.PMessageBuilder<MessageType>
-
descriptor
@Nonnull public net.morimekta.providence.descriptor.PStructDescriptor<MessageType> descriptor()
- Specified by:
descriptorin interfacenet.morimekta.providence.PMessageOrBuilder<MessageType>- Specified by:
descriptorin interfacenet.morimekta.providence.PValue<MessageType>
-
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
@Nonnull public MessageType build()
- Specified by:
buildin interfaceDecl._Builder- Specified by:
buildin interfacenet.morimekta.providence.PBuilder<MessageType>- Returns:
- The built instance
-
-