public static class Any._Builder extends PMessageBuilder<Any,Any._Field> implements BinaryReader
| Constructor and Description |
|---|
_Builder()
Make a putil.Any builder instance.
|
_Builder(Any base)
Make a mutating builder off a base putil.Any.
|
| Modifier and Type | Method and Description |
|---|---|
Any._Builder |
addTo(int key,
Object value)
Adds a value to a set or list container.
|
Any |
build()
Build the instance value.
|
Any._Builder |
clear(int key)
Clear the provided field value.
|
Any._Builder |
clearData()
Clear the
data field. |
Any._Builder |
clearMediaType()
Clear the
media_type field. |
Any._Builder |
clearText()
Clear the
text field. |
Any._Builder |
clearType()
Clear the
type field. |
PStructDescriptor<Any,Any._Field> |
descriptor()
Get the descriptor for the message being built.
|
boolean |
equals(Object o) |
net.morimekta.util.Binary |
getData()
The actual content binary data.
|
String |
getMediaType()
The media type used for encoding.
|
String |
getText()
Optional string encoded content for non-binary media types.
|
String |
getType()
The thrift / providence program + message type name.
|
int |
hashCode() |
boolean |
isModified(int key)
Checks if a specific field is modified on the builder.
|
boolean |
isModifiedData()
Checks if the
data field has been modified since the
builder was created. |
boolean |
isModifiedMediaType()
Checks if the
media_type field has been modified since the
builder was created. |
boolean |
isModifiedText()
Checks if the
text field has been modified since the
builder was created. |
boolean |
isModifiedType()
Checks if the
type field has been modified since the
builder was created. |
boolean |
isSet(int key)
Checks if a specific field is set on the builder.
|
boolean |
isSetData()
Checks for presence of the
data field. |
boolean |
isSetMediaType()
Checks for presence of the
media_type field. |
boolean |
isSetText()
Checks for presence of the
text field. |
boolean |
isSetType()
Checks for presence of the
type field. |
Any._Builder |
merge(Any 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.
|
Any._Builder |
set(int key,
Object value)
Set the provided field value.
|
Any._Builder |
setData(net.morimekta.util.Binary value)
Set the
data field value. |
Any._Builder |
setMediaType(String value)
Set the
media_type field value. |
Any._Builder |
setText(String value)
Set the
text field value. |
Any._Builder |
setType(String value)
Set the
type field value. |
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.
|
addTo, clear, isModified, isSet, modifiedFields, mutator, presentFields, setpublic _Builder()
public _Builder(Any base)
base - The base Any@Nonnull public Any._Builder merge(Any from)
PMessageBuildermerge in class PMessageBuilder<Any,Any._Field>from - The message to merge values from.@Nonnull public Any._Builder setType(String value)
type field value.
The thrift / providence program + message type name. This should refer to a message type. Enums will need to be wrapped in a message to be contained.
value - The new valuepublic boolean isSetType()
type field.public boolean isModifiedType()
type field has been modified since the
builder was created.@Nonnull public Any._Builder clearType()
type field.public String getType()
type field value@Nonnull public Any._Builder setMediaType(String value)
media_type field value.
The media type used for encoding. There will need to exist a serializer registered for this. If the media type is not set, it is assumed to be 'application/vnd.apache.thrift.binary', the default thrift serialization.
value - The new valuepublic boolean isSetMediaType()
media_type field.public boolean isModifiedMediaType()
media_type field has been modified since the
builder was created.@Nonnull public Any._Builder clearMediaType()
media_type field.public String getMediaType()
media_type field value@Nonnull public Any._Builder setData(net.morimekta.util.Binary value)
data field value.
The actual content binary data.
value - The new valuepublic boolean isSetData()
data field.public boolean isModifiedData()
data field has been modified since the
builder was created.@Nonnull public Any._Builder clearData()
data field.public net.morimekta.util.Binary getData()
data field value@Nonnull public Any._Builder setText(String value)
text field value.
Optional string encoded content for non-binary media types. If this is filled in, then the 'bin' field is not needed.
value - The new valuepublic boolean isSetText()
text field.public boolean isModifiedText()
text field has been modified since the
builder was created.@Nonnull public Any._Builder clearText()
text field.public String getText()
text field valuepublic PMessageBuilder mutator(int key)
PMessageBuildermutator in class PMessageBuilder<Any,Any._Field>key - The field key.@Nonnull public Any._Builder set(int key, Object value)
PMessageBuilderset in class PMessageBuilder<Any,Any._Field>key - The key of the field to set.value - The value to be set.public boolean isSet(int key)
PMessageBuilderisSet in class PMessageBuilder<Any,Any._Field>key - The key of the field to check.public boolean isModified(int key)
PMessageBuilderisModified in class PMessageBuilder<Any,Any._Field>key - The key of the field to check.public Any._Builder addTo(int key, Object value)
PMessageBuilderaddTo in class PMessageBuilder<Any,Any._Field>key - The key of the container field to add too.value - The value to add.@Nonnull public Any._Builder clear(int key)
PMessageBuilderclear in class PMessageBuilder<Any,Any._Field>key - The key of the field to clear.public boolean valid()
PMessageBuildervalid in class PMessageBuilder<Any,Any._Field>public void validate()
PMessageBuilderIllegalStateException with an appropriate error
message.validate in class PMessageBuilder<Any,Any._Field>@Nonnull public PStructDescriptor<Any,Any._Field> descriptor()
PMessageBuilderdescriptor in class PMessageBuilder<Any,Any._Field>public void readBinary(net.morimekta.util.io.BigEndianBinaryReader reader,
boolean strict)
throws IOException
BinaryReaderBinarySerializer.deserialize(InputStream, PMessageDescriptor)
call.readBinary in interface BinaryReaderreader - The reader to read from.strict - If content should be handled strictly. True means to fail
on everything that Apache thrift failed read() on.IOException - When unable to read message for any reason.Copyright © 2015–2018 morimekta.net. All rights reserved.