Package net.morimekta.providence.model
Class ConstType._Builder
- java.lang.Object
-
- net.morimekta.providence.PMessageBuilder<ConstType>
-
- net.morimekta.providence.model.ConstType._Builder
-
- All Implemented Interfaces:
ConstType_OrBuilder,Decl,Decl._Builder,net.morimekta.providence.PMessageOrBuilder<ConstType>,net.morimekta.providence.PValue<ConstType>,net.morimekta.providence.serializer.binary.BinaryReader
- Enclosing class:
- ConstType
public static class ConstType._Builder extends net.morimekta.providence.PMessageBuilder<ConstType> implements Decl._Builder, ConstType_OrBuilder, net.morimekta.providence.serializer.binary.BinaryReader
const <type> <name> = <value>
-
-
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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConstType._BuilderaddTo(int key, java.lang.Object value)ConstTypebuild()ConstType._Builderclear(int key)ConstType._BuilderclearAnnotations()Clear theannotationsfield.ConstType._BuilderclearDocumentation()Clear thedocumentationfield.ConstType._BuilderclearName()Clear thenamefield.ConstType._BuilderclearType()Clear thetypefield.ConstType._BuilderclearValue()Clear thevaluefield.net.morimekta.providence.descriptor.PStructDescriptor<ConstType>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.lang.StringgetName()Name of the type, constant or service.java.lang.StringgetType()java.lang.StringgetValue()booleanhas(int key)booleanhasAnnotations()Checks for presence of theannotationsfield.booleanhasDocumentation()Checks for presence of thedocumentationfield.inthashCode()booleanhasName()Checks for presence of thenamefield.booleanhasType()Checks for presence of thetypefield.booleanhasValue()Checks for presence of thevaluefield.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.booleanisModifiedName()Checks if thenamefield has been modified since the builder was created.booleanisModifiedType()Checks if thetypefield has been modified since the builder was created.booleanisModifiedValue()Checks if thevaluefield 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.booleanisSetName()Checks for explicit presence of thenamefield.booleanisSetType()Checks for explicit presence of thetypefield.booleanisSetValue()Checks for explicit presence of thevaluefield.ConstType._Buildermerge(ConstType from)java.util.Map<java.lang.String,java.lang.String>mutableAnnotations()net.morimekta.providence.PMessageBuildermutator(int key)intnumAnnotations()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.ConstType._BuilderputInAnnotations(java.lang.String key, java.lang.String value)Adds a mapping to theannotationsmap.voidreadBinary(net.morimekta.util.io.BigEndianBinaryReader reader, boolean strict)ConstType._Builderset(int key, java.lang.Object value)ConstType._BuildersetAnnotations(java.util.Map<java.lang.String,java.lang.String> value)Set theannotationsfield value.ConstType._BuildersetDocumentation(java.lang.String value)Set thedocumentationfield value.ConstType._BuildersetName(java.lang.String value)Set thenamefield value.ConstType._BuildersetType(java.lang.String value)Set thetypefield value.ConstType._BuildersetValue(java.lang.String value)Set thevaluefield value.booleanvalid()ConstType._Buildervalidate()-
Methods inherited from class net.morimekta.providence.PMessageBuilder
addTo, clear, isModified, isSet, modifiedFieldNames, modifiedFields, mutator, presentFieldNames, presentFields, set
-
-
-
-
Constructor Detail
-
_Builder
public _Builder()
Make a p_model.ConstType builder instance.
-
_Builder
public _Builder(ConstType base)
Make a mutating builder off a base p_model.ConstType.- Parameters:
base- The base ConstType
-
-
Method Detail
-
merge
@Nonnull public ConstType._Builder merge(ConstType from)
- Specified by:
mergein classnet.morimekta.providence.PMessageBuilder<ConstType>
-
setDocumentation
@Nonnull public ConstType._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 ConstType._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
-
setType
@Nonnull public ConstType._Builder setType(java.lang.String value)
Set thetypefield value.- Parameters:
value- The new value- Returns:
- The builder
-
isSetType
public boolean isSetType()
Checks for explicit presence of thetypefield.- Returns:
- True if type has been set.
-
hasType
public boolean hasType()
Checks for presence of thetypefield.- Specified by:
hasTypein interfaceConstType_OrBuilder- Returns:
- True if type is present.
-
isModifiedType
public boolean isModifiedType()
Checks if thetypefield has been modified since the builder was created.- Returns:
- True if type has been modified.
-
clearType
@Nonnull public ConstType._Builder clearType()
Clear thetypefield.- Returns:
- The builder
-
getType
public java.lang.String getType()
- Specified by:
getTypein interfaceConstType_OrBuilder- Returns:
- The
typefield value
-
setName
@Nonnull public ConstType._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 ConstType._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.
-
setValue
@Nonnull public ConstType._Builder setValue(java.lang.String value)
Set thevaluefield value.- Parameters:
value- The new value- Returns:
- The builder
-
isSetValue
public boolean isSetValue()
Checks for explicit presence of thevaluefield.- Returns:
- True if value has been set.
-
hasValue
public boolean hasValue()
Checks for presence of thevaluefield.- Specified by:
hasValuein interfaceConstType_OrBuilder- Returns:
- True if value is present.
-
isModifiedValue
public boolean isModifiedValue()
Checks if thevaluefield has been modified since the builder was created.- Returns:
- True if value has been modified.
-
clearValue
@Nonnull public ConstType._Builder clearValue()
Clear thevaluefield.- Returns:
- The builder
-
getValue
public java.lang.String getValue()
- Specified by:
getValuein interfaceConstType_OrBuilder- Returns:
- The
valuefield value
-
setAnnotations
@Nonnull public ConstType._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 ConstType._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 interfaceConstType_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 ConstType._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 interfaceConstType_OrBuilder- Returns:
- The
annotationsfield value
-
optionalAnnotations
@Nonnull public java.util.Optional<java.util.Map<java.lang.String,java.lang.String>> optionalAnnotations()
- Specified by:
optionalAnnotationsin interfaceConstType_OrBuilder- Returns:
- Optional
annotationsfield value
-
numAnnotations
public int numAnnotations()
- Specified by:
numAnnotationsin interfaceConstType_OrBuilder- Returns:
- Number of entries in
annotations.
-
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<ConstType>
-
set
@Nonnull public ConstType._Builder set(int key, java.lang.Object value)
- Specified by:
setin classnet.morimekta.providence.PMessageBuilder<ConstType>
-
isSet
public boolean isSet(int key)
- Specified by:
isSetin classnet.morimekta.providence.PMessageBuilder<ConstType>
-
isModified
public boolean isModified(int key)
- Specified by:
isModifiedin classnet.morimekta.providence.PMessageBuilder<ConstType>
-
get
public <T> T get(int key)
- Specified by:
getin interfacenet.morimekta.providence.PMessageOrBuilder<ConstType>
-
has
public boolean has(int key)
- Specified by:
hasin interfacenet.morimekta.providence.PMessageOrBuilder<ConstType>
-
addTo
@Nonnull public ConstType._Builder addTo(int key, java.lang.Object value)
- Specified by:
addToin classnet.morimekta.providence.PMessageBuilder<ConstType>
-
clear
@Nonnull public ConstType._Builder clear(int key)
- Specified by:
clearin classnet.morimekta.providence.PMessageBuilder<ConstType>
-
valid
public boolean valid()
- Specified by:
validin classnet.morimekta.providence.PMessageBuilder<ConstType>
-
validate
public ConstType._Builder validate()
- Specified by:
validatein classnet.morimekta.providence.PMessageBuilder<ConstType>
-
descriptor
@Nonnull public net.morimekta.providence.descriptor.PStructDescriptor<ConstType> descriptor()
-
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 ConstType build()
- Specified by:
buildin interfaceDecl._Builder- Specified by:
buildin classnet.morimekta.providence.PMessageBuilder<ConstType>- Returns:
- The built instance
-
-