Class 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.
    • Constructor Summary

      Constructors 
      Constructor Description
      _Builder()
      Make a providence.Any builder.
      _Builder​(Any base)
      Make a mutating builder off a base providence.Any.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Any._Builder addTo​(int key, java.lang.Object value)  
      Any build()  
      Any._Builder clear​(int key)  
      Any._Builder clearBin()
      The actual content binary data.
      Any._Builder clearMediaType()
      The media type used for encoding.
      Any._Builder clearStr()
      Optional string encoded content for non-binary media types.
      Any._Builder clearType()
      The thrift / providence program + message type name.
      net.morimekta.providence.descriptor.PStructDescriptor<Any,Any._Field> descriptor()  
      boolean equals​(java.lang.Object o)  
      net.morimekta.util.Binary getBin()
      The actual content binary data.
      java.lang.String getMediaType()
      The media type used for encoding.
      java.lang.String getStr()
      Optional string encoded content for non-binary media types.
      java.lang.String getType()
      The thrift / providence program + message type name.
      int hashCode()  
      boolean isModified​(int key)  
      boolean isModifiedBin()
      The actual content binary data.
      boolean isModifiedMediaType()
      The media type used for encoding.
      boolean isModifiedStr()
      Optional string encoded content for non-binary media types.
      boolean isModifiedType()
      The thrift / providence program + message type name.
      boolean isSet​(int key)  
      boolean isSetBin()
      The actual content binary data.
      boolean isSetMediaType()
      The media type used for encoding.
      boolean isSetStr()
      Optional string encoded content for non-binary media types.
      boolean isSetType()
      The thrift / providence program + message type name.
      Any._Builder merge​(Any from)  
      net.morimekta.providence.PMessageBuilder mutator​(int key)  
      void readBinary​(net.morimekta.util.io.BigEndianBinaryReader reader, boolean strict)  
      Any._Builder set​(int key, java.lang.Object value)  
      Any._Builder setBin​(net.morimekta.util.Binary value)
      The actual content binary data.
      Any._Builder setMediaType​(java.lang.String value)
      The media type used for encoding.
      Any._Builder setStr​(java.lang.String value)
      Optional string encoded content for non-binary media types.
      Any._Builder setType​(java.lang.String value)
      The thrift / providence program + message type name.
      boolean valid()  
      void validate()  
      • 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.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:
        merge in class net.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:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • mutator

        public net.morimekta.providence.PMessageBuilder mutator​(int key)
        Specified by:
        mutator in class net.morimekta.providence.PMessageBuilder<Any,Any._Field>
      • set

        @Nonnull
        public Any._Builder set​(int key,
                                java.lang.Object value)
        Specified by:
        set in class net.morimekta.providence.PMessageBuilder<Any,Any._Field>
      • isSet

        public boolean isSet​(int key)
        Specified by:
        isSet in class net.morimekta.providence.PMessageBuilder<Any,Any._Field>
      • isModified

        public boolean isModified​(int key)
        Specified by:
        isModified in class net.morimekta.providence.PMessageBuilder<Any,Any._Field>
      • addTo

        public Any._Builder addTo​(int key,
                                  java.lang.Object value)
        Specified by:
        addTo in class net.morimekta.providence.PMessageBuilder<Any,Any._Field>
      • clear

        @Nonnull
        public Any._Builder clear​(int key)
        Specified by:
        clear in class net.morimekta.providence.PMessageBuilder<Any,Any._Field>
      • valid

        public boolean valid()
        Specified by:
        valid in class net.morimekta.providence.PMessageBuilder<Any,Any._Field>
      • validate

        public void validate()
        Specified by:
        validate in class net.morimekta.providence.PMessageBuilder<Any,Any._Field>
      • descriptor

        @Nonnull
        public net.morimekta.providence.descriptor.PStructDescriptor<Any,Any._Field> descriptor()
        Specified by:
        descriptor in class net.morimekta.providence.PMessageBuilder<Any,Any._Field>
      • readBinary

        public void readBinary​(net.morimekta.util.io.BigEndianBinaryReader reader,
                               boolean strict)
                        throws java.io.IOException
        Specified by:
        readBinary in interface net.morimekta.providence.serializer.binary.BinaryReader
        Throws:
        java.io.IOException
      • build

        public Any build()
        Specified by:
        build in interface net.morimekta.providence.PBuilder<Any>