Package net.morimekta.providence
Class Any._Builder
- java.lang.Object
-
- net.morimekta.providence.PMessageBuilder<Any,Any._Field>
-
- net.morimekta.providence.Any._Builder
-
- All Implemented Interfaces:
net.morimekta.providence.PBuilder<Any>,net.morimekta.providence.serializer.binary.BinaryReader
- Enclosing class:
- Any
public static class Any._Builder extends net.morimekta.providence.PMessageBuilder<Any,Any._Field> implements net.morimekta.providence.serializer.binary.BinaryReader
A message containing anything.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Any._BuilderaddTo(int key, java.lang.Object value)Anybuild()Any._Builderclear(int key)Any._BuilderclearBin()The actual content binary data.Any._BuilderclearMediaType()The media type used for encoding.Any._BuilderclearStr()Optional string encoded content for non-binary media types.Any._BuilderclearType()The thrift / providence program + message type name.net.morimekta.providence.descriptor.PStructDescriptor<Any,Any._Field>descriptor()booleanequals(java.lang.Object o)net.morimekta.util.BinarygetBin()The actual content binary data.java.lang.StringgetMediaType()The media type used for encoding.java.lang.StringgetStr()Optional string encoded content for non-binary media types.java.lang.StringgetType()The thrift / providence program + message type name.inthashCode()booleanisModified(int key)booleanisModifiedBin()The actual content binary data.booleanisModifiedMediaType()The media type used for encoding.booleanisModifiedStr()Optional string encoded content for non-binary media types.booleanisModifiedType()The thrift / providence program + message type name.booleanisSet(int key)booleanisSetBin()The actual content binary data.booleanisSetMediaType()The media type used for encoding.booleanisSetStr()Optional string encoded content for non-binary media types.booleanisSetType()The thrift / providence program + message type name.Any._Buildermerge(Any from)net.morimekta.providence.PMessageBuildermutator(int key)voidreadBinary(net.morimekta.util.io.BigEndianBinaryReader reader, boolean strict)Any._Builderset(int key, java.lang.Object value)Any._BuildersetBin(net.morimekta.util.Binary value)The actual content binary data.Any._BuildersetMediaType(java.lang.String value)The media type used for encoding.Any._BuildersetStr(java.lang.String value)Optional string encoded content for non-binary media types.Any._BuildersetType(java.lang.String value)The thrift / providence program + message type name.booleanvalid()voidvalidate()
-
-
-
Constructor Detail
-
_Builder
public _Builder()
Make a providence.Any builder.
-
_Builder
public _Builder(Any base)
Make a mutating builder off a base providence.Any.- Parameters:
base- The base Any
-
-
Method Detail
-
merge
@Nonnull public Any._Builder merge(Any from)
- Specified by:
mergein classnet.morimekta.providence.PMessageBuilder<Any,Any._Field>
-
setType
@Nonnull public Any._Builder setType(java.lang.String 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.- Parameters:
value- The new value- Returns:
- The builder
-
isSetType
public boolean isSetType()
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.- Returns:
- True if type has been set.
-
isModifiedType
public boolean isModifiedType()
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.- Returns:
- True if type has been modified.
-
clearType
@Nonnull public Any._Builder clearType()
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.- Returns:
- The builder
-
getType
public java.lang.String getType()
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.- Returns:
- The field value
-
setMediaType
@Nonnull public Any._Builder setMediaType(java.lang.String 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.- Parameters:
value- The new value- Returns:
- The builder
-
isSetMediaType
public boolean isSetMediaType()
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.- Returns:
- True if media_type has been set.
-
isModifiedMediaType
public boolean isModifiedMediaType()
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.- Returns:
- True if media_type has been modified.
-
clearMediaType
@Nonnull public Any._Builder clearMediaType()
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.- Returns:
- The builder
-
getMediaType
public java.lang.String getMediaType()
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.- Returns:
- The field value
-
setBin
@Nonnull public Any._Builder setBin(net.morimekta.util.Binary value)
The actual content binary data.- Parameters:
value- The new value- Returns:
- The builder
-
isSetBin
public boolean isSetBin()
The actual content binary data.- Returns:
- True if bin has been set.
-
isModifiedBin
public boolean isModifiedBin()
The actual content binary data.- Returns:
- True if bin has been modified.
-
clearBin
@Nonnull public Any._Builder clearBin()
The actual content binary data.- Returns:
- The builder
-
getBin
public net.morimekta.util.Binary getBin()
The actual content binary data.- Returns:
- The field value
-
setStr
@Nonnull public Any._Builder setStr(java.lang.String value)
Optional string encoded content for non-binary media types. If this is filled in, then the 'bin' field is not needed.- Parameters:
value- The new value- Returns:
- The builder
-
isSetStr
public boolean isSetStr()
Optional string encoded content for non-binary media types. If this is filled in, then the 'bin' field is not needed.- Returns:
- True if str has been set.
-
isModifiedStr
public boolean isModifiedStr()
Optional string encoded content for non-binary media types. If this is filled in, then the 'bin' field is not needed.- Returns:
- True if str has been modified.
-
clearStr
@Nonnull public Any._Builder clearStr()
Optional string encoded content for non-binary media types. If this is filled in, then the 'bin' field is not needed.- Returns:
- The builder
-
getStr
public java.lang.String getStr()
Optional string encoded content for non-binary media types. If this is filled in, then the 'bin' field is not needed.- 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<Any,Any._Field>
-
set
@Nonnull public Any._Builder set(int key, java.lang.Object value)
- Specified by:
setin classnet.morimekta.providence.PMessageBuilder<Any,Any._Field>
-
isSet
public boolean isSet(int key)
- Specified by:
isSetin classnet.morimekta.providence.PMessageBuilder<Any,Any._Field>
-
isModified
public boolean isModified(int key)
- Specified by:
isModifiedin classnet.morimekta.providence.PMessageBuilder<Any,Any._Field>
-
addTo
public Any._Builder addTo(int key, java.lang.Object value)
- Specified by:
addToin classnet.morimekta.providence.PMessageBuilder<Any,Any._Field>
-
clear
@Nonnull public Any._Builder clear(int key)
- Specified by:
clearin classnet.morimekta.providence.PMessageBuilder<Any,Any._Field>
-
valid
public boolean valid()
- Specified by:
validin classnet.morimekta.providence.PMessageBuilder<Any,Any._Field>
-
validate
public void validate()
- Specified by:
validatein classnet.morimekta.providence.PMessageBuilder<Any,Any._Field>
-
descriptor
@Nonnull public net.morimekta.providence.descriptor.PStructDescriptor<Any,Any._Field> descriptor()
- Specified by:
descriptorin classnet.morimekta.providence.PMessageBuilder<Any,Any._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
-
-