Package net.morimekta.providence.model
Class FunctionType._Builder
- java.lang.Object
-
- net.morimekta.providence.PMessageBuilder<FunctionType>
-
- net.morimekta.providence.model.FunctionType._Builder
-
- All Implemented Interfaces:
Decl
,Decl._Builder
,FunctionType_OrBuilder
,PMessageOrBuilder<FunctionType>
,PValue<FunctionType>
,BinaryReader
- Enclosing class:
- FunctionType
public static class FunctionType._Builder extends PMessageBuilder<FunctionType> implements Decl._Builder, FunctionType_OrBuilder, BinaryReader
(oneway)? <return_type> <name>'('<param>*')' (throws '(' <exception>+ ')')?
-
-
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.FunctionType builder instance._Builder(FunctionType base)
Make a mutating builder off a base p_model.FunctionType.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FunctionType._Builder
addTo(int key, java.lang.Object value)
Adds a value to a set or list container.FunctionType._Builder
addToExceptions(FieldType... values)
Adds entries to theexceptions
list.FunctionType._Builder
addToParams(FieldType... values)
Adds entries to theparams
list.FunctionType
build()
FunctionType._Builder
clear(int key)
Clear the provided field value.FunctionType._Builder
clearAnnotations()
Clear theannotations
field.FunctionType._Builder
clearDocumentation()
Clear thedocumentation
field.FunctionType._Builder
clearExceptions()
Clear theexceptions
field.FunctionType._Builder
clearName()
Clear thename
field.FunctionType._Builder
clearOneWay()
Clear theone_way
field.FunctionType._Builder
clearParams()
Clear theparams
field.FunctionType._Builder
clearReturnType()
Clear thereturn_type
field.PStructDescriptor<FunctionType>
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.util.List<FieldType>
getExceptions()
java.lang.String
getName()
Name of the type, constant or service.java.util.List<FieldType>
getParams()
java.lang.String
getReturnType()
boolean
has(int key)
boolean
hasAnnotations()
Checks for presence of theannotations
field.boolean
hasDocumentation()
Checks for presence of thedocumentation
field.boolean
hasExceptions()
Checks for presence of theexceptions
field.int
hashCode()
boolean
hasName()
Checks for presence of thename
field.boolean
hasOneWay()
Checks for presence of theone_way
field.boolean
hasParams()
Checks for presence of theparams
field.boolean
hasReturnType()
Checks for presence of thereturn_type
field.boolean
isModified(int key)
Checks if a specific field is modified on the builder.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
isModifiedExceptions()
Checks if theexceptions
field has been modified since the builder was created.boolean
isModifiedName()
Checks if thename
field has been modified since the builder was created.boolean
isModifiedOneWay()
Checks if theone_way
field has been modified since the builder was created.boolean
isModifiedParams()
Checks if theparams
field has been modified since the builder was created.boolean
isModifiedReturnType()
Checks if thereturn_type
field has been modified since the builder was created.boolean
isOneWay()
boolean
isSet(int key)
Checks if a specific field is set on the builder.boolean
isSetAnnotations()
Checks for explicit presence of theannotations
field.boolean
isSetDocumentation()
Checks for explicit presence of thedocumentation
field.boolean
isSetExceptions()
Checks for explicit presence of theexceptions
field.boolean
isSetName()
Checks for explicit presence of thename
field.boolean
isSetOneWay()
Checks for explicit presence of theone_way
field.boolean
isSetParams()
Checks for explicit presence of theparams
field.boolean
isSetReturnType()
Checks for explicit presence of thereturn_type
field.FunctionType._Builder
merge(FunctionType from)
Merges the provided message into the builder.java.util.Map<java.lang.String,java.lang.String>
mutableAnnotations()
java.util.List<FieldType>
mutableExceptions()
java.util.List<FieldType>
mutableParams()
PMessageBuilder
mutator(int key)
Get the builder for the given message contained in this builder.int
numAnnotations()
int
numExceptions()
int
numParams()
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.util.List<FieldType>>
optionalExceptions()
java.util.Optional<java.lang.Boolean>
optionalOneWay()
java.util.Optional<java.lang.String>
optionalReturnType()
FunctionType._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)
Read the binary content into the current builder.FunctionType._Builder
set(int key, java.lang.Object value)
Set the provided field value.FunctionType._Builder
setAnnotations(java.util.Map<java.lang.String,java.lang.String> value)
Set theannotations
field value.FunctionType._Builder
setDocumentation(java.lang.String value)
Set thedocumentation
field value.FunctionType._Builder
setExceptions(java.util.Collection<FieldType> value)
Set theexceptions
field value.FunctionType._Builder
setName(java.lang.String value)
Set thename
field value.FunctionType._Builder
setOneWay(boolean value)
Set theone_way
field value.FunctionType._Builder
setOneWay(java.lang.Boolean value)
Set theone_way
field value.FunctionType._Builder
setParams(java.util.Collection<FieldType> value)
Set theparams
field value.FunctionType._Builder
setReturnType(java.lang.String value)
Set thereturn_type
field value.boolean
valid()
Checks if the current set data is enough to make a valid struct.FunctionType._Builder
validate()
Checks if the current set data is enough to make a valid struct.-
Methods inherited from class net.morimekta.providence.PMessageBuilder
addTo, clear, isModified, isSet, modifiedFields, mutator, presentFields, set
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.morimekta.providence.PMessageOrBuilder
get, has, toBuilder, toMessage
-
-
-
-
Constructor Detail
-
_Builder
public _Builder()
Make a p_model.FunctionType builder instance.
-
_Builder
public _Builder(FunctionType base)
Make a mutating builder off a base p_model.FunctionType.- Parameters:
base
- The base FunctionType
-
-
Method Detail
-
merge
@Nonnull public FunctionType._Builder merge(FunctionType 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<FunctionType>
- Parameters:
from
- The message to merge values from.- Returns:
- The builder itself.
-
setDocumentation
@Nonnull public FunctionType._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 FunctionType._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
-
setOneWay
@Nonnull public FunctionType._Builder setOneWay(java.lang.Boolean value)
Set theone_way
field value.- Parameters:
value
- The new value- Returns:
- The builder
-
setOneWay
@Nonnull public FunctionType._Builder setOneWay(boolean value)
Set theone_way
field value.- Parameters:
value
- The new value- Returns:
- The builder
-
isSetOneWay
public boolean isSetOneWay()
Checks for explicit presence of theone_way
field.- Returns:
- True if one_way has been set.
-
hasOneWay
public boolean hasOneWay()
Checks for presence of theone_way
field.- Specified by:
hasOneWay
in interfaceFunctionType_OrBuilder
- Returns:
- True if one_way is present.
-
isModifiedOneWay
public boolean isModifiedOneWay()
Checks if theone_way
field has been modified since the builder was created.- Returns:
- True if one_way has been modified.
-
clearOneWay
@Nonnull public FunctionType._Builder clearOneWay()
Clear theone_way
field.- Returns:
- The builder
-
isOneWay
public boolean isOneWay()
- Specified by:
isOneWay
in interfaceFunctionType_OrBuilder
- Returns:
- The
one_way
field value
-
optionalOneWay
@Nonnull public java.util.Optional<java.lang.Boolean> optionalOneWay()
- Specified by:
optionalOneWay
in interfaceFunctionType_OrBuilder
- Returns:
- Optional
one_way
field value
-
setReturnType
@Nonnull public FunctionType._Builder setReturnType(java.lang.String value)
Set thereturn_type
field value.- Parameters:
value
- The new value- Returns:
- The builder
-
isSetReturnType
public boolean isSetReturnType()
Checks for explicit presence of thereturn_type
field.- Returns:
- True if return_type has been set.
-
hasReturnType
public boolean hasReturnType()
Checks for presence of thereturn_type
field.- Specified by:
hasReturnType
in interfaceFunctionType_OrBuilder
- Returns:
- True if return_type is present.
-
isModifiedReturnType
public boolean isModifiedReturnType()
Checks if thereturn_type
field has been modified since the builder was created.- Returns:
- True if return_type has been modified.
-
clearReturnType
@Nonnull public FunctionType._Builder clearReturnType()
Clear thereturn_type
field.- Returns:
- The builder
-
getReturnType
public java.lang.String getReturnType()
- Specified by:
getReturnType
in interfaceFunctionType_OrBuilder
- Returns:
- The
return_type
field value
-
optionalReturnType
@Nonnull public java.util.Optional<java.lang.String> optionalReturnType()
- Specified by:
optionalReturnType
in interfaceFunctionType_OrBuilder
- Returns:
- Optional
return_type
field value
-
setName
@Nonnull public FunctionType._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 FunctionType._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.
-
setParams
@Nonnull public FunctionType._Builder setParams(java.util.Collection<FieldType> value)
Set theparams
field value.- Parameters:
value
- The new value- Returns:
- The builder
-
addToParams
@Nonnull public FunctionType._Builder addToParams(FieldType... values)
Adds entries to theparams
list.- Parameters:
values
- The added value- Returns:
- The builder
-
isSetParams
public boolean isSetParams()
Checks for explicit presence of theparams
field.- Returns:
- True if params has been set.
-
hasParams
public boolean hasParams()
Checks for presence of theparams
field.- Specified by:
hasParams
in interfaceFunctionType_OrBuilder
- Returns:
- True if params is present.
-
isModifiedParams
public boolean isModifiedParams()
Checks if theparams
field has been modified since the builder was created.- Returns:
- True if params has been modified.
-
clearParams
@Nonnull public FunctionType._Builder clearParams()
Clear theparams
field.- Returns:
- The builder
-
mutableParams
public java.util.List<FieldType> mutableParams()
- Returns:
- The mutable
params
container
-
getParams
public java.util.List<FieldType> getParams()
- Specified by:
getParams
in interfaceFunctionType_OrBuilder
- Returns:
- The
params
field value
-
numParams
public int numParams()
- Specified by:
numParams
in interfaceFunctionType_OrBuilder
- Returns:
- Number of entries in
params
.
-
setExceptions
@Nonnull public FunctionType._Builder setExceptions(java.util.Collection<FieldType> value)
Set theexceptions
field value.- Parameters:
value
- The new value- Returns:
- The builder
-
addToExceptions
@Nonnull public FunctionType._Builder addToExceptions(FieldType... values)
Adds entries to theexceptions
list.- Parameters:
values
- The added value- Returns:
- The builder
-
isSetExceptions
public boolean isSetExceptions()
Checks for explicit presence of theexceptions
field.- Returns:
- True if exceptions has been set.
-
hasExceptions
public boolean hasExceptions()
Checks for presence of theexceptions
field.- Specified by:
hasExceptions
in interfaceFunctionType_OrBuilder
- Returns:
- True if exceptions is present.
-
isModifiedExceptions
public boolean isModifiedExceptions()
Checks if theexceptions
field has been modified since the builder was created.- Returns:
- True if exceptions has been modified.
-
clearExceptions
@Nonnull public FunctionType._Builder clearExceptions()
Clear theexceptions
field.- Returns:
- The builder
-
mutableExceptions
public java.util.List<FieldType> mutableExceptions()
- Returns:
- The mutable
exceptions
container
-
getExceptions
public java.util.List<FieldType> getExceptions()
- Specified by:
getExceptions
in interfaceFunctionType_OrBuilder
- Returns:
- The
exceptions
field value
-
optionalExceptions
@Nonnull public java.util.Optional<java.util.List<FieldType>> optionalExceptions()
- Specified by:
optionalExceptions
in interfaceFunctionType_OrBuilder
- Returns:
- Optional
exceptions
field value
-
numExceptions
public int numExceptions()
- Specified by:
numExceptions
in interfaceFunctionType_OrBuilder
- Returns:
- Number of entries in
exceptions
.
-
setAnnotations
@Nonnull public FunctionType._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 FunctionType._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 interfaceFunctionType_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 FunctionType._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 interfaceFunctionType_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 interfaceFunctionType_OrBuilder
- Returns:
- Optional
annotations
field value
-
numAnnotations
public int numAnnotations()
- Specified by:
numAnnotations
in interfaceFunctionType_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 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<FunctionType>
- Parameters:
key
- The field key.- Returns:
- The field builder.
-
set
@Nonnull public FunctionType._Builder set(int key, java.lang.Object value)
Description copied from class:PMessageBuilder
Set the provided field value.- Specified by:
set
in classPMessageBuilder<FunctionType>
- 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<FunctionType>
- 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<FunctionType>
- Parameters:
key
- The key of the field to check.- Returns:
- True if the field is modified.
-
get
public <T> T get(int key)
- Specified by:
get
in interfacePMessageOrBuilder<FunctionType>
- Type Parameters:
T
- The return type.- Parameters:
key
- The key of the field.- Returns:
- The value of the field.
-
has
public boolean has(int key)
- Specified by:
has
in interfacePMessageOrBuilder<FunctionType>
- Parameters:
key
- The key of the field.- Returns:
- Whether the field is present.
-
addTo
@Nonnull public FunctionType._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<FunctionType>
- Parameters:
key
- The key of the container field to add too.value
- The value to add.- Returns:
- The builder itself.
-
clear
@Nonnull public FunctionType._Builder clear(int key)
Description copied from class:PMessageBuilder
Clear the provided field value.- Specified by:
clear
in classPMessageBuilder<FunctionType>
- Parameters:
key
- The key of the field to clear.- Returns:
- The builder itself.
-
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<FunctionType>
- Returns:
- True for a valid message.
-
validate
public FunctionType._Builder 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<FunctionType>
- Returns:
- The builder itself.
-
descriptor
@Nonnull public PStructDescriptor<FunctionType> descriptor()
- Specified by:
descriptor
in interfacePMessageOrBuilder<FunctionType>
- Specified by:
descriptor
in interfacePValue<FunctionType>
-
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
@Nonnull public FunctionType build()
- Specified by:
build
in interfaceDecl._Builder
- Specified by:
build
in classPMessageBuilder<FunctionType>
- Returns:
- The built instance
-
-