Package net.morimekta.providence.model
Class FieldType._Builder
- java.lang.Object
-
- net.morimekta.providence.PMessageBuilder<FieldType,FieldType._Field>
-
- net.morimekta.providence.model.FieldType._Builder
-
- All Implemented Interfaces:
net.morimekta.providence.PBuilder<FieldType>,net.morimekta.providence.serializer.binary.BinaryReader
- Enclosing class:
- FieldType
public static class FieldType._Builder extends net.morimekta.providence.PMessageBuilder<FieldType,FieldType._Field> implements net.morimekta.providence.serializer.binary.BinaryReader
For fields: (<key>:)? (required|optional)? <type> <name> (= <default_value>)? For const: const <type> <name> = <default_value>Fields without key is assigned values ranging from 65335 and down (2^16-1) in order of appearance. Because of the "in order of appearance" the field *must* be filled by the IDL parser.
Consts are always given the key '0'.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldType._BuilderaddTo(int key, java.lang.Object value)FieldTypebuild()FieldType._Builderclear(int key)FieldType._BuilderclearAnnotations()Clears the annotations field.FieldType._BuilderclearDefaultValue()Clears the default_value field.FieldType._BuilderclearDocumentation()Clears the documentation field.FieldType._BuilderclearId()Clears the id field.FieldType._BuilderclearName()Clears the name field.FieldType._BuilderclearRequirement()Clears the requirement field.FieldType._BuilderclearStartLineNo()Note the start of the default value in the parsed thrift file, this can be used for making more accurate exception / parse data from the const parser.FieldType._BuilderclearStartLinePos()Clears the start_line_pos field.FieldType._BuilderclearType()Clears the type field.net.morimekta.providence.descriptor.PStructDescriptor<FieldType,FieldType._Field>descriptor()booleanequals(java.lang.Object o)java.lang.StringgetDefaultValue()Gets the value of the contained default_value.java.lang.StringgetDocumentation()Gets the value of the contained documentation.intgetId()Gets the value of the contained id.java.lang.StringgetName()Gets the value of the contained name.FieldRequirementgetRequirement()Gets the value of the contained requirement.intgetStartLineNo()Note the start of the default value in the parsed thrift file, this can be used for making more accurate exception / parse data from the const parser.intgetStartLinePos()Gets the value of the contained start_line_pos.java.lang.StringgetType()Gets the value of the contained type.inthashCode()booleanisModified(int key)booleanisModifiedAnnotations()Checks if annotations has been modified since the _Builder was created.booleanisModifiedDefaultValue()Checks if default_value has been modified since the _Builder was created.booleanisModifiedDocumentation()Checks if documentation has been modified since the _Builder was created.booleanisModifiedId()Checks if id has been modified since the _Builder was created.booleanisModifiedName()Checks if name has been modified since the _Builder was created.booleanisModifiedRequirement()Checks if requirement has been modified since the _Builder was created.booleanisModifiedStartLineNo()Note the start of the default value in the parsed thrift file, this can be used for making more accurate exception / parse data from the const parser.booleanisModifiedStartLinePos()Checks if start_line_pos has been modified since the _Builder was created.booleanisModifiedType()Checks if type has been modified since the _Builder was created.booleanisSet(int key)booleanisSetAnnotations()Checks for presence of the annotations field.booleanisSetDefaultValue()Checks for presence of the default_value field.booleanisSetDocumentation()Checks for presence of the documentation field.booleanisSetId()Checks for presence of the id field.booleanisSetName()Checks for presence of the name field.booleanisSetRequirement()Checks for presence of the requirement field.booleanisSetStartLineNo()Note the start of the default value in the parsed thrift file, this can be used for making more accurate exception / parse data from the const parser.booleanisSetStartLinePos()Checks for presence of the start_line_pos field.booleanisSetType()Checks for presence of the type field.FieldType._Buildermerge(FieldType from)java.util.Map<java.lang.String,java.lang.String>mutableAnnotations()Gets the builder for the contained annotations.net.morimekta.providence.PMessageBuildermutator(int key)FieldType._BuilderputInAnnotations(java.lang.String key, java.lang.String value)Adds a mapping to annotations.voidreadBinary(net.morimekta.util.io.BigEndianBinaryReader reader, boolean strict)FieldType._Builderset(int key, java.lang.Object value)FieldType._BuildersetAnnotations(java.util.Map<java.lang.String,java.lang.String> value)Sets the value of annotations.FieldType._BuildersetDefaultValue(java.lang.String value)Sets the value of default_value.FieldType._BuildersetDocumentation(java.lang.String value)Sets the value of documentation.FieldType._BuildersetId(int value)Sets the value of id.FieldType._BuildersetName(java.lang.String value)Sets the value of name.FieldType._BuildersetRequirement(FieldRequirement value)Sets the value of requirement.FieldType._BuildersetStartLineNo(int value)Note the start of the default value in the parsed thrift file, this can be used for making more accurate exception / parse data from the const parser.FieldType._BuildersetStartLinePos(int value)Sets the value of start_line_pos.FieldType._BuildersetType(java.lang.String value)Sets the value of type.booleanvalid()voidvalidate()
-
-
-
Constructor Detail
-
_Builder
public _Builder()
Make a providence_model.FieldType builder.
-
_Builder
public _Builder(FieldType base)
Make a mutating builder off a base providence_model.FieldType.- Parameters:
base- The base FieldType
-
-
Method Detail
-
merge
@Nonnull public FieldType._Builder merge(FieldType from)
- Specified by:
mergein classnet.morimekta.providence.PMessageBuilder<FieldType,FieldType._Field>
-
setDocumentation
@Nonnull public FieldType._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 FieldType._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
-
setId
@Nonnull public FieldType._Builder setId(int value)
Sets the value of id.- Parameters:
value- The new value- Returns:
- The builder
-
isSetId
public boolean isSetId()
Checks for presence of the id field.- Returns:
- True if id has been set.
-
isModifiedId
public boolean isModifiedId()
Checks if id has been modified since the _Builder was created.- Returns:
- True if id has been modified.
-
clearId
@Nonnull public FieldType._Builder clearId()
Clears the id field.- Returns:
- The builder
-
getId
public int getId()
Gets the value of the contained id.- Returns:
- The field value
-
setRequirement
@Nonnull public FieldType._Builder setRequirement(FieldRequirement value)
Sets the value of requirement.- Parameters:
value- The new value- Returns:
- The builder
-
isSetRequirement
public boolean isSetRequirement()
Checks for presence of the requirement field.- Returns:
- True if requirement has been set.
-
isModifiedRequirement
public boolean isModifiedRequirement()
Checks if requirement has been modified since the _Builder was created.- Returns:
- True if requirement has been modified.
-
clearRequirement
@Nonnull public FieldType._Builder clearRequirement()
Clears the requirement field.- Returns:
- The builder
-
getRequirement
public FieldRequirement getRequirement()
Gets the value of the contained requirement.- Returns:
- The field value
-
setType
@Nonnull public FieldType._Builder setType(java.lang.String value)
Sets the value of type.- Parameters:
value- The new value- Returns:
- The builder
-
isSetType
public boolean isSetType()
Checks for presence of the type field.- Returns:
- True if type has been set.
-
isModifiedType
public boolean isModifiedType()
Checks if type has been modified since the _Builder was created.- Returns:
- True if type has been modified.
-
clearType
@Nonnull public FieldType._Builder clearType()
Clears the type field.- Returns:
- The builder
-
getType
public java.lang.String getType()
Gets the value of the contained type.- Returns:
- The field value
-
setName
@Nonnull public FieldType._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 FieldType._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
-
setDefaultValue
@Nonnull public FieldType._Builder setDefaultValue(java.lang.String value)
Sets the value of default_value.- Parameters:
value- The new value- Returns:
- The builder
-
isSetDefaultValue
public boolean isSetDefaultValue()
Checks for presence of the default_value field.- Returns:
- True if default_value has been set.
-
isModifiedDefaultValue
public boolean isModifiedDefaultValue()
Checks if default_value has been modified since the _Builder was created.- Returns:
- True if default_value has been modified.
-
clearDefaultValue
@Nonnull public FieldType._Builder clearDefaultValue()
Clears the default_value field.- Returns:
- The builder
-
getDefaultValue
public java.lang.String getDefaultValue()
Gets the value of the contained default_value.- Returns:
- The field value
-
setAnnotations
@Nonnull public FieldType._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 FieldType._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 FieldType._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
-
setStartLineNo
@Nonnull public FieldType._Builder setStartLineNo(int value)
Note the start of the default value in the parsed thrift file, this can be used for making more accurate exception / parse data from the const parser.- Parameters:
value- The new value- Returns:
- The builder
-
isSetStartLineNo
public boolean isSetStartLineNo()
Note the start of the default value in the parsed thrift file, this can be used for making more accurate exception / parse data from the const parser.- Returns:
- True if start_line_no has been set.
-
isModifiedStartLineNo
public boolean isModifiedStartLineNo()
Note the start of the default value in the parsed thrift file, this can be used for making more accurate exception / parse data from the const parser.- Returns:
- True if start_line_no has been modified.
-
clearStartLineNo
@Nonnull public FieldType._Builder clearStartLineNo()
Note the start of the default value in the parsed thrift file, this can be used for making more accurate exception / parse data from the const parser.- Returns:
- The builder
-
getStartLineNo
public int getStartLineNo()
Note the start of the default value in the parsed thrift file, this can be used for making more accurate exception / parse data from the const parser.- Returns:
- The field value
-
setStartLinePos
@Nonnull public FieldType._Builder setStartLinePos(int value)
Sets the value of start_line_pos.- Parameters:
value- The new value- Returns:
- The builder
-
isSetStartLinePos
public boolean isSetStartLinePos()
Checks for presence of the start_line_pos field.- Returns:
- True if start_line_pos has been set.
-
isModifiedStartLinePos
public boolean isModifiedStartLinePos()
Checks if start_line_pos has been modified since the _Builder was created.- Returns:
- True if start_line_pos has been modified.
-
clearStartLinePos
@Nonnull public FieldType._Builder clearStartLinePos()
Clears the start_line_pos field.- Returns:
- The builder
-
getStartLinePos
public int getStartLinePos()
Gets the value of the contained start_line_pos.- 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<FieldType,FieldType._Field>
-
set
@Nonnull public FieldType._Builder set(int key, java.lang.Object value)
- Specified by:
setin classnet.morimekta.providence.PMessageBuilder<FieldType,FieldType._Field>
-
isSet
public boolean isSet(int key)
- Specified by:
isSetin classnet.morimekta.providence.PMessageBuilder<FieldType,FieldType._Field>
-
isModified
public boolean isModified(int key)
- Specified by:
isModifiedin classnet.morimekta.providence.PMessageBuilder<FieldType,FieldType._Field>
-
addTo
public FieldType._Builder addTo(int key, java.lang.Object value)
- Specified by:
addToin classnet.morimekta.providence.PMessageBuilder<FieldType,FieldType._Field>
-
clear
@Nonnull public FieldType._Builder clear(int key)
- Specified by:
clearin classnet.morimekta.providence.PMessageBuilder<FieldType,FieldType._Field>
-
valid
public boolean valid()
- Specified by:
validin classnet.morimekta.providence.PMessageBuilder<FieldType,FieldType._Field>
-
validate
public void validate()
- Specified by:
validatein classnet.morimekta.providence.PMessageBuilder<FieldType,FieldType._Field>
-
descriptor
@Nonnull public net.morimekta.providence.descriptor.PStructDescriptor<FieldType,FieldType._Field> descriptor()
- Specified by:
descriptorin classnet.morimekta.providence.PMessageBuilder<FieldType,FieldType._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
-
-