Package net.morimekta.providence.model
Class TypedefType._Builder
- java.lang.Object
-
- net.morimekta.providence.PMessageBuilder<TypedefType,TypedefType._Field>
-
- net.morimekta.providence.model.TypedefType._Builder
-
- All Implemented Interfaces:
PBuilder<TypedefType>
,BinaryReader
- Enclosing class:
- TypedefType
public static class TypedefType._Builder extends PMessageBuilder<TypedefType,TypedefType._Field> implements BinaryReader
typedef <type> <name>
-
-
Constructor Summary
Constructors Constructor Description _Builder()
Make a providence_model.TypedefType builder._Builder(TypedefType base)
Make a mutating builder off a base providence_model.TypedefType.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TypedefType._Builder
addTo(int key, java.lang.Object value)
Adds a value to a set or list container.TypedefType
build()
Build the instance value.TypedefType._Builder
clear(int key)
Clear the provided field value.TypedefType._Builder
clearDocumentation()
Clears the documentation field.TypedefType._Builder
clearName()
Clears the name field.TypedefType._Builder
clearType()
Clears the type field.PStructDescriptor<TypedefType,TypedefType._Field>
descriptor()
Get the descriptor for the message being built.boolean
equals(java.lang.Object o)
java.lang.String
getDocumentation()
Gets the value of the contained documentation.java.lang.String
getName()
Gets the value of the contained name.java.lang.String
getType()
Gets the value of the contained type.int
hashCode()
boolean
isModified(int key)
Checks if a specific field is modified on the builder.boolean
isModifiedDocumentation()
Checks if documentation has been modified since the _Builder was created.boolean
isModifiedName()
Checks if name has been modified since the _Builder was created.boolean
isModifiedType()
Checks if type has been modified since the _Builder was created.boolean
isSet(int key)
Checks if a specific field is set on the builder.boolean
isSetDocumentation()
Checks for presence of the documentation field.boolean
isSetName()
Checks for presence of the name field.boolean
isSetType()
Checks for presence of the type field.TypedefType._Builder
merge(TypedefType from)
Merges the provided message into the builder.PMessageBuilder
mutator(int key)
Get the builder for the given message contained in this builder.void
readBinary(net.morimekta.util.io.BigEndianBinaryReader reader, boolean strict)
Read the binary content into the current builder.TypedefType._Builder
set(int key, java.lang.Object value)
Set the provided field value.TypedefType._Builder
setDocumentation(java.lang.String value)
Sets the value of documentation.TypedefType._Builder
setName(java.lang.String value)
Sets the value of name.TypedefType._Builder
setType(java.lang.String value)
Sets the value of type.boolean
valid()
Checks if the current set data is enough to make a valid struct.void
validate()
Checks if the current set data is enough to make a valid struct.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from class net.morimekta.providence.PMessageBuilder
addTo, clear, isModified, isSet, modifiedFields, mutator, presentFields, set
-
-
-
-
Constructor Detail
-
_Builder
public _Builder()
Make a providence_model.TypedefType builder.
-
_Builder
public _Builder(TypedefType base)
Make a mutating builder off a base providence_model.TypedefType.- Parameters:
base
- The base TypedefType
-
-
Method Detail
-
merge
@Nonnull public TypedefType._Builder merge(TypedefType from)
Description copied from class:PMessageBuilder
Merges the provided message into the builder. Contained messages should in turn be merged and not replaced wholesale. Sets are unioned (addAll) and maps will overwrite / replace on a per-key basis (putAll).- Specified by:
merge
in classPMessageBuilder<TypedefType,TypedefType._Field>
- Parameters:
from
- The message to merge values from.- Returns:
- The message builder.
-
setDocumentation
@Nonnull public TypedefType._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 TypedefType._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
-
setType
@Nonnull public TypedefType._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 TypedefType._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 TypedefType._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 TypedefType._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
-
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 PMessageBuilder mutator(int key)
Description copied from class:PMessageBuilder
Get the builder for the given message contained in this builder. If the sub-builder does not exist, create, either from existing instance or from scratch.- Specified by:
mutator
in classPMessageBuilder<TypedefType,TypedefType._Field>
- Parameters:
key
- The field key.- Returns:
- The field builder.
-
set
@Nonnull public TypedefType._Builder set(int key, java.lang.Object value)
Description copied from class:PMessageBuilder
Set the provided field value.- Specified by:
set
in classPMessageBuilder<TypedefType,TypedefType._Field>
- Parameters:
key
- The key of the field to set.value
- The value to be set.- Returns:
- The message builder.
-
isSet
public boolean isSet(int key)
Description copied from class:PMessageBuilder
Checks if a specific field is set on the builder.- Specified by:
isSet
in classPMessageBuilder<TypedefType,TypedefType._Field>
- Parameters:
key
- The key of the field to check.- Returns:
- True if the field is set.
-
isModified
public boolean isModified(int key)
Description copied from class:PMessageBuilder
Checks if a specific field is modified on the builder.- Specified by:
isModified
in classPMessageBuilder<TypedefType,TypedefType._Field>
- Parameters:
key
- The key of the field to check.- Returns:
- True if the field is modified.
-
addTo
public TypedefType._Builder addTo(int key, java.lang.Object value)
Description copied from class:PMessageBuilder
Adds a value to a set or list container.- Specified by:
addTo
in classPMessageBuilder<TypedefType,TypedefType._Field>
- Parameters:
key
- The key of the container field to add too.value
- The value to add.- Returns:
- The message builder.
-
clear
@Nonnull public TypedefType._Builder clear(int key)
Description copied from class:PMessageBuilder
Clear the provided field value.- Specified by:
clear
in classPMessageBuilder<TypedefType,TypedefType._Field>
- Parameters:
key
- The key of the field to clear.- Returns:
- The message builder.
-
valid
public boolean valid()
Description copied from class:PMessageBuilder
Checks if the current set data is enough to make a valid struct. It will check for all required fields, and if any are missing it will return false.- Specified by:
valid
in classPMessageBuilder<TypedefType,TypedefType._Field>
- Returns:
- True for a valid message.
-
validate
public void validate()
Description copied from class:PMessageBuilder
Checks if the current set data is enough to make a valid struct. It will check for all required fields, and if any are missing it will throw anIllegalStateException
with an appropriate error message.- Specified by:
validate
in classPMessageBuilder<TypedefType,TypedefType._Field>
-
descriptor
@Nonnull public PStructDescriptor<TypedefType,TypedefType._Field> descriptor()
Description copied from class:PMessageBuilder
Get the descriptor for the message being built.- Specified by:
descriptor
in classPMessageBuilder<TypedefType,TypedefType._Field>
- Returns:
- The struct descriptor.
-
readBinary
public void readBinary(net.morimekta.util.io.BigEndianBinaryReader reader, boolean strict) throws java.io.IOException
Description copied from interface:BinaryReader
Read the binary content into the current builder. NOTE: This method is not intended to be used directly. Instead use theBinarySerializer.deserialize(InputStream, PMessageDescriptor)
call.- Specified by:
readBinary
in interfaceBinaryReader
- Parameters:
reader
- The reader to read from.strict
- If content should be handled strictly. True means to fail on everything that Apache thrift failed read() on.- Throws:
java.io.IOException
- When unable to read message for any reason.
-
build
public TypedefType build()
Description copied from interface:PBuilder
Build the instance value.- Specified by:
build
in interfacePBuilder<TypedefType>
- Returns:
- The instance value.
-
-