Class Declaration._Builder

    • Constructor Detail

      • _Builder

        public _Builder()
        Make a p_model.Declaration builder instance.
      • _Builder

        public _Builder​(Declaration base)
        Make a mutating builder off a base p_model.Declaration.
        Parameters:
        base - The base Declaration
    • Method Detail

      • merge

        @Nonnull
        public Declaration._Builder merge​(Declaration 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 class PMessageBuilder<Declaration>
        Parameters:
        from - The message to merge values from.
        Returns:
        The builder itself.
      • isSetDeclEnum

        public boolean isSetDeclEnum()
        Checks for explicit presence of the decl_enum field.
        Returns:
        True if decl_enum has been set.
      • hasDeclEnum

        public boolean hasDeclEnum()
        Checks for presence of the decl_enum field.
        Specified by:
        hasDeclEnum in interface Declaration_OrBuilder
        Returns:
        True if decl_enum is present.
      • clearDeclEnum

        @Nonnull
        public Declaration._Builder clearDeclEnum()
        Clear the decl_enum field.
        Returns:
        The builder
      • mutableDeclEnum

        @Nonnull
        public EnumType._Builder mutableDeclEnum()
        Get the builder for the contained decl_enum message field.
        Returns:
        The field message builder
      • isSetDeclTypedef

        public boolean isSetDeclTypedef()
        Checks for explicit presence of the decl_typedef field.
        Returns:
        True if decl_typedef has been set.
      • hasDeclTypedef

        public boolean hasDeclTypedef()
        Checks for presence of the decl_typedef field.
        Specified by:
        hasDeclTypedef in interface Declaration_OrBuilder
        Returns:
        True if decl_typedef is present.
      • clearDeclTypedef

        @Nonnull
        public Declaration._Builder clearDeclTypedef()
        Clear the decl_typedef field.
        Returns:
        The builder
      • mutableDeclTypedef

        @Nonnull
        public TypedefType._Builder mutableDeclTypedef()
        Get the builder for the contained decl_typedef message field.
        Returns:
        The field message builder
      • isSetDeclMessage

        public boolean isSetDeclMessage()
        Checks for explicit presence of the decl_message field.
        Returns:
        True if decl_message has been set.
      • hasDeclMessage

        public boolean hasDeclMessage()
        Checks for presence of the decl_message field.
        Specified by:
        hasDeclMessage in interface Declaration_OrBuilder
        Returns:
        True if decl_message is present.
      • clearDeclMessage

        @Nonnull
        public Declaration._Builder clearDeclMessage()
        Clear the decl_message field.
        Returns:
        The builder
      • mutableDeclMessage

        @Nonnull
        public MessageType._Builder mutableDeclMessage()
        Get the builder for the contained decl_message message field.
        Returns:
        The field message builder
      • isSetDeclService

        public boolean isSetDeclService()
        Checks for explicit presence of the decl_service field.
        Returns:
        True if decl_service has been set.
      • hasDeclService

        public boolean hasDeclService()
        Checks for presence of the decl_service field.
        Specified by:
        hasDeclService in interface Declaration_OrBuilder
        Returns:
        True if decl_service is present.
      • clearDeclService

        @Nonnull
        public Declaration._Builder clearDeclService()
        Clear the decl_service field.
        Returns:
        The builder
      • mutableDeclService

        @Nonnull
        public ServiceType._Builder mutableDeclService()
        Get the builder for the contained decl_service message field.
        Returns:
        The field message builder
      • isSetDeclConst

        public boolean isSetDeclConst()
        Checks for explicit presence of the decl_const field.
        Returns:
        True if decl_const has been set.
      • hasDeclConst

        public boolean hasDeclConst()
        Checks for presence of the decl_const field.
        Specified by:
        hasDeclConst in interface Declaration_OrBuilder
        Returns:
        True if decl_const is present.
      • clearDeclConst

        @Nonnull
        public Declaration._Builder clearDeclConst()
        Clear the decl_const field.
        Returns:
        The builder
      • mutableDeclConst

        @Nonnull
        public ConstType._Builder mutableDeclConst()
        Get the builder for the contained decl_const message field.
        Returns:
        The field message builder
      • isUnionModified

        public boolean isUnionModified()
        Checks if the Declaration union has been modified since the builder was created.
        Returns:
        True if Declaration has been modified.
      • 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 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 class PMessageBuilder<Declaration>
        Parameters:
        key - The field key.
        Returns:
        The field builder.
      • set

        @Nonnull
        public Declaration._Builder set​(int key,
                                        java.lang.Object value)
        Description copied from class: PMessageBuilder
        Set the provided field value.
        Specified by:
        set in class PMessageBuilder<Declaration>
        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 class PMessageBuilder<Declaration>
        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 class PMessageBuilder<Declaration>
        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 interface PMessageOrBuilder<Declaration>
        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 interface PMessageOrBuilder<Declaration>
        Parameters:
        key - The key of the field.
        Returns:
        Whether the field is present.
      • addTo

        @Nonnull
        public Declaration._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 class PMessageBuilder<Declaration>
        Parameters:
        key - The key of the container field to add too.
        value - The value to add.
        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 class PMessageBuilder<Declaration>
        Returns:
        True for a valid message.
      • validate

        public Declaration._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 an IllegalStateException with an appropriate error message.
        Specified by:
        validate in class PMessageBuilder<Declaration>
        Returns:
        The builder itself.
      • 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 the BinarySerializer.deserialize(InputStream, PMessageDescriptor) call.
        Specified by:
        readBinary in interface BinaryReader
        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.