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._Builder
addTo(int key, java.lang.Object value)
ConstType
build()
ConstType._Builder
clear(int key)
ConstType._Builder
clearAnnotations()
Clear theannotations
field.ConstType._Builder
clearDocumentation()
Clear thedocumentation
field.ConstType._Builder
clearName()
Clear thename
field.ConstType._Builder
clearType()
Clear thetype
field.ConstType._Builder
clearValue()
Clear thevalue
field.net.morimekta.providence.descriptor.PStructDescriptor<ConstType>
descriptor()
boolean
equals(java.lang.Object o)
<T> T
get(int key)
java.util.Map<java.lang.String,java.lang.String>
getAnnotations()
java.lang.String
getDocumentation()
Documentation for the specific declaration.java.lang.String
getName()
Name of the type, constant or service.java.lang.String
getType()
java.lang.String
getValue()
boolean
has(int key)
boolean
hasAnnotations()
Checks for presence of theannotations
field.boolean
hasDocumentation()
Checks for presence of thedocumentation
field.int
hashCode()
boolean
hasName()
Checks for presence of thename
field.boolean
hasType()
Checks for presence of thetype
field.boolean
hasValue()
Checks for presence of thevalue
field.boolean
isModified(int key)
boolean
isModifiedAnnotations()
Checks if theannotations
field has been modified since the builder was created.boolean
isModifiedDocumentation()
Checks if thedocumentation
field has been modified since the builder was created.boolean
isModifiedName()
Checks if thename
field has been modified since the builder was created.boolean
isModifiedType()
Checks if thetype
field has been modified since the builder was created.boolean
isModifiedValue()
Checks if thevalue
field has been modified since the builder was created.boolean
isSet(int key)
boolean
isSetAnnotations()
Checks for explicit presence of theannotations
field.boolean
isSetDocumentation()
Checks for explicit presence of thedocumentation
field.boolean
isSetName()
Checks for explicit presence of thename
field.boolean
isSetType()
Checks for explicit presence of thetype
field.boolean
isSetValue()
Checks for explicit presence of thevalue
field.ConstType._Builder
merge(ConstType from)
java.util.Map<java.lang.String,java.lang.String>
mutableAnnotations()
net.morimekta.providence.PMessageBuilder
mutator(int key)
int
numAnnotations()
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._Builder
putInAnnotations(java.lang.String key, java.lang.String value)
Adds a mapping to theannotations
map.void
readBinary(net.morimekta.util.io.BigEndianBinaryReader reader, boolean strict)
ConstType._Builder
set(int key, java.lang.Object value)
ConstType._Builder
setAnnotations(java.util.Map<java.lang.String,java.lang.String> value)
Set theannotations
field value.ConstType._Builder
setDocumentation(java.lang.String value)
Set thedocumentation
field value.ConstType._Builder
setName(java.lang.String value)
Set thename
field value.ConstType._Builder
setType(java.lang.String value)
Set thetype
field value.ConstType._Builder
setValue(java.lang.String value)
Set thevalue
field value.boolean
valid()
ConstType._Builder
validate()
-
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.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:
merge
in classnet.morimekta.providence.PMessageBuilder<ConstType>
-
setDocumentation
@Nonnull public ConstType._Builder setDocumentation(java.lang.String value)
Set thedocumentation
field value.- Specified by:
setDocumentation
in interfaceDecl._Builder
- Parameters:
value
- The new value- Returns:
- The builder
-
isSetDocumentation
public boolean isSetDocumentation()
Checks for explicit presence of thedocumentation
field.- Returns:
- True if documentation has been set.
-
hasDocumentation
public boolean hasDocumentation()
Checks for presence of thedocumentation
field.- Specified by:
hasDocumentation
in interfaceDecl
- Returns:
- True if documentation is present.
-
isModifiedDocumentation
public boolean isModifiedDocumentation()
Checks if thedocumentation
field has been modified since the builder was created.- Returns:
- True if documentation has been modified.
-
clearDocumentation
@Nonnull public ConstType._Builder clearDocumentation()
Clear thedocumentation
field.- Specified by:
clearDocumentation
in interfaceDecl._Builder
- Returns:
- The builder
-
getDocumentation
public java.lang.String getDocumentation()
Description copied from interface:Decl
Documentation for the specific declaration.- Specified by:
getDocumentation
in interfaceDecl
- Returns:
- The
documentation
field value
-
optionalDocumentation
@Nonnull public java.util.Optional<java.lang.String> optionalDocumentation()
Description copied from interface:Decl
Documentation for the specific declaration.- Specified by:
optionalDocumentation
in interfaceDecl
- Returns:
- Optional
documentation
field value
-
setType
@Nonnull public ConstType._Builder setType(java.lang.String value)
Set thetype
field value.- Parameters:
value
- The new value- Returns:
- The builder
-
isSetType
public boolean isSetType()
Checks for explicit presence of thetype
field.- Returns:
- True if type has been set.
-
hasType
public boolean hasType()
Checks for presence of thetype
field.- Specified by:
hasType
in interfaceConstType_OrBuilder
- Returns:
- True if type is present.
-
isModifiedType
public boolean isModifiedType()
Checks if thetype
field has been modified since the builder was created.- Returns:
- True if type has been modified.
-
clearType
@Nonnull public ConstType._Builder clearType()
Clear thetype
field.- Returns:
- The builder
-
getType
public java.lang.String getType()
- Specified by:
getType
in interfaceConstType_OrBuilder
- Returns:
- The
type
field value
-
setName
@Nonnull public ConstType._Builder setName(java.lang.String value)
Set thename
field value.- Specified by:
setName
in interfaceDecl._Builder
- Parameters:
value
- The new value- Returns:
- The builder
-
isSetName
public boolean isSetName()
Checks for explicit presence of thename
field.- Returns:
- True if name has been set.
-
hasName
public boolean hasName()
Checks for presence of thename
field.
-
isModifiedName
public boolean isModifiedName()
Checks if thename
field has been modified since the builder was created.- Returns:
- True if name has been modified.
-
clearName
@Nonnull public ConstType._Builder clearName()
Clear thename
field.- Specified by:
clearName
in interfaceDecl._Builder
- Returns:
- The builder
-
getName
public java.lang.String getName()
Description copied from interface:Decl
Name of the type, constant or service.
-
setValue
@Nonnull public ConstType._Builder setValue(java.lang.String value)
Set thevalue
field value.- Parameters:
value
- The new value- Returns:
- The builder
-
isSetValue
public boolean isSetValue()
Checks for explicit presence of thevalue
field.- Returns:
- True if value has been set.
-
hasValue
public boolean hasValue()
Checks for presence of thevalue
field.- Specified by:
hasValue
in interfaceConstType_OrBuilder
- Returns:
- True if value is present.
-
isModifiedValue
public boolean isModifiedValue()
Checks if thevalue
field has been modified since the builder was created.- Returns:
- True if value has been modified.
-
clearValue
@Nonnull public ConstType._Builder clearValue()
Clear thevalue
field.- Returns:
- The builder
-
getValue
public java.lang.String getValue()
- Specified by:
getValue
in interfaceConstType_OrBuilder
- Returns:
- The
value
field value
-
setAnnotations
@Nonnull public ConstType._Builder setAnnotations(java.util.Map<java.lang.String,java.lang.String> value)
Set theannotations
field 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 theannotations
map.- Parameters:
key
- The inserted keyvalue
- The inserted value- Returns:
- The builder
-
isSetAnnotations
public boolean isSetAnnotations()
Checks for explicit presence of theannotations
field.- Returns:
- True if annotations has been set.
-
hasAnnotations
public boolean hasAnnotations()
Checks for presence of theannotations
field.- Specified by:
hasAnnotations
in interfaceConstType_OrBuilder
- Returns:
- True if annotations is present.
-
isModifiedAnnotations
public boolean isModifiedAnnotations()
Checks if theannotations
field has been modified since the builder was created.- Returns:
- True if annotations has been modified.
-
clearAnnotations
@Nonnull public ConstType._Builder clearAnnotations()
Clear theannotations
field.- Returns:
- The builder
-
mutableAnnotations
public java.util.Map<java.lang.String,java.lang.String> mutableAnnotations()
- Returns:
- The mutable
annotations
container
-
getAnnotations
public java.util.Map<java.lang.String,java.lang.String> getAnnotations()
- Specified by:
getAnnotations
in interfaceConstType_OrBuilder
- Returns:
- The
annotations
field value
-
optionalAnnotations
@Nonnull public java.util.Optional<java.util.Map<java.lang.String,java.lang.String>> optionalAnnotations()
- Specified by:
optionalAnnotations
in interfaceConstType_OrBuilder
- Returns:
- Optional
annotations
field value
-
numAnnotations
public int numAnnotations()
- Specified by:
numAnnotations
in interfaceConstType_OrBuilder
- Returns:
- Number of entries in
annotations
.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
mutator
public net.morimekta.providence.PMessageBuilder mutator(int key)
- Specified by:
mutator
in classnet.morimekta.providence.PMessageBuilder<ConstType>
-
set
@Nonnull public ConstType._Builder set(int key, java.lang.Object value)
- Specified by:
set
in classnet.morimekta.providence.PMessageBuilder<ConstType>
-
isSet
public boolean isSet(int key)
- Specified by:
isSet
in classnet.morimekta.providence.PMessageBuilder<ConstType>
-
isModified
public boolean isModified(int key)
- Specified by:
isModified
in classnet.morimekta.providence.PMessageBuilder<ConstType>
-
get
public <T> T get(int key)
- Specified by:
get
in interfacenet.morimekta.providence.PMessageOrBuilder<ConstType>
-
has
public boolean has(int key)
- Specified by:
has
in interfacenet.morimekta.providence.PMessageOrBuilder<ConstType>
-
addTo
@Nonnull public ConstType._Builder addTo(int key, java.lang.Object value)
- Specified by:
addTo
in classnet.morimekta.providence.PMessageBuilder<ConstType>
-
clear
@Nonnull public ConstType._Builder clear(int key)
- Specified by:
clear
in classnet.morimekta.providence.PMessageBuilder<ConstType>
-
valid
public boolean valid()
- Specified by:
valid
in classnet.morimekta.providence.PMessageBuilder<ConstType>
-
validate
public ConstType._Builder validate()
- Specified by:
validate
in 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:
readBinary
in interfacenet.morimekta.providence.serializer.binary.BinaryReader
- Throws:
java.io.IOException
-
build
@Nonnull public ConstType build()
- Specified by:
build
in interfaceDecl._Builder
- Specified by:
build
in classnet.morimekta.providence.PMessageBuilder<ConstType>
- Returns:
- The built instance
-
-