Class ProgramType._Builder

    • Constructor Detail

      • _Builder

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

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

      • merge

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

        @Nonnull
        public ProgramType._Builder setDocumentation​(java.lang.String value)
        Set the documentation field value.

        Program documentation must come before the first statement of the header.

        Parameters:
        value - The new value
        Returns:
        The builder
      • isSetDocumentation

        public boolean isSetDocumentation()
        Checks for explicit presence of the documentation field.
        Returns:
        True if documentation has been set.
      • hasDocumentation

        public boolean hasDocumentation()
        Checks for presence of the documentation field.
        Specified by:
        hasDocumentation in interface ProgramType_OrBuilder
        Returns:
        True if documentation is present.
      • isModifiedDocumentation

        public boolean isModifiedDocumentation()
        Checks if the documentation field has been modified since the builder was created.
        Returns:
        True if documentation has been modified.
      • clearDocumentation

        @Nonnull
        public ProgramType._Builder clearDocumentation()
        Clear the documentation field.
        Returns:
        The builder
      • getDocumentation

        public java.lang.String getDocumentation()
        Program documentation must come before the first statement of the header.
        Specified by:
        getDocumentation in interface ProgramType_OrBuilder
        Returns:
        The documentation field value
      • optionalDocumentation

        @Nonnull
        public java.util.Optional<java.lang.String> optionalDocumentation()
        Program documentation must come before the first statement of the header.
        Specified by:
        optionalDocumentation in interface ProgramType_OrBuilder
        Returns:
        Optional documentation field value
      • setProgramName

        @Nonnull
        public ProgramType._Builder setProgramName​(java.lang.String value)
        Set the program_name field value.

        The program name, deducted from the .thrift IDL file name.

        Parameters:
        value - The new value
        Returns:
        The builder
      • isSetProgramName

        public boolean isSetProgramName()
        Checks for explicit presence of the program_name field.
        Returns:
        True if program_name has been set.
      • hasProgramName

        public boolean hasProgramName()
        Checks for presence of the program_name field.
        Specified by:
        hasProgramName in interface ProgramType_OrBuilder
        Returns:
        True if program_name is present.
      • isModifiedProgramName

        public boolean isModifiedProgramName()
        Checks if the program_name field has been modified since the builder was created.
        Returns:
        True if program_name has been modified.
      • clearProgramName

        @Nonnull
        public ProgramType._Builder clearProgramName()
        Clear the program_name field.
        Returns:
        The builder
      • getProgramName

        public java.lang.String getProgramName()
        The program name, deducted from the .thrift IDL file name.
        Specified by:
        getProgramName in interface ProgramType_OrBuilder
        Returns:
        The program_name field value
      • setIncludes

        @Nonnull
        public ProgramType._Builder setIncludes​(java.util.Map<java.lang.String,​java.lang.String> value)
        Set the includes field value.

        List of included thrift files. Same as from the actual thrift file.

        include "<program>.thrift"

        Parameters:
        value - The new value
        Returns:
        The builder
      • putInIncludes

        @Nonnull
        public ProgramType._Builder putInIncludes​(java.lang.String key,
                                                  java.lang.String value)
        Adds a mapping to the includes map.

        List of included thrift files. Same as from the actual thrift file.

        include "<program>.thrift"

        Parameters:
        key - The inserted key
        value - The inserted value
        Returns:
        The builder
      • isSetIncludes

        public boolean isSetIncludes()
        Checks for explicit presence of the includes field.
        Returns:
        True if includes has been set.
      • hasIncludes

        public boolean hasIncludes()
        Checks for presence of the includes field.
        Specified by:
        hasIncludes in interface ProgramType_OrBuilder
        Returns:
        True if includes is present.
      • isModifiedIncludes

        public boolean isModifiedIncludes()
        Checks if the includes field has been modified since the builder was created.
        Returns:
        True if includes has been modified.
      • clearIncludes

        @Nonnull
        public ProgramType._Builder clearIncludes()
        Clear the includes field.
        Returns:
        The builder
      • mutableIncludes

        public java.util.Map<java.lang.String,​java.lang.String> mutableIncludes()
        List of included thrift files. Same as from the actual thrift file.

        include "<program>.thrift"

        Returns:
        The mutable includes container
      • getIncludes

        public java.util.Map<java.lang.String,​java.lang.String> getIncludes()
        List of included thrift files. Same as from the actual thrift file.

        include "<program>.thrift"

        Specified by:
        getIncludes in interface ProgramType_OrBuilder
        Returns:
        The includes field value
      • optionalIncludes

        @Nonnull
        public java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>> optionalIncludes()
        List of included thrift files. Same as from the actual thrift file.

        include "<program>.thrift"

        Specified by:
        optionalIncludes in interface ProgramType_OrBuilder
        Returns:
        Optional includes field value
      • numIncludes

        public int numIncludes()
        List of included thrift files. Same as from the actual thrift file.

        include "<program>.thrift"

        Specified by:
        numIncludes in interface ProgramType_OrBuilder
        Returns:
        Number of entries in includes.
      • setNamespaces

        @Nonnull
        public ProgramType._Builder setNamespaces​(java.util.Map<java.lang.String,​java.lang.String> value)
        Set the namespaces field value.

        Map of language to laguage dependent namespace identifier.

        namespace <key> <value>

        Parameters:
        value - The new value
        Returns:
        The builder
      • putInNamespaces

        @Nonnull
        public ProgramType._Builder putInNamespaces​(java.lang.String key,
                                                    java.lang.String value)
        Adds a mapping to the namespaces map.

        Map of language to laguage dependent namespace identifier.

        namespace <key> <value>

        Parameters:
        key - The inserted key
        value - The inserted value
        Returns:
        The builder
      • isSetNamespaces

        public boolean isSetNamespaces()
        Checks for explicit presence of the namespaces field.
        Returns:
        True if namespaces has been set.
      • hasNamespaces

        public boolean hasNamespaces()
        Checks for presence of the namespaces field.
        Specified by:
        hasNamespaces in interface ProgramType_OrBuilder
        Returns:
        True if namespaces is present.
      • isModifiedNamespaces

        public boolean isModifiedNamespaces()
        Checks if the namespaces field has been modified since the builder was created.
        Returns:
        True if namespaces has been modified.
      • clearNamespaces

        @Nonnull
        public ProgramType._Builder clearNamespaces()
        Clear the namespaces field.
        Returns:
        The builder
      • mutableNamespaces

        public java.util.Map<java.lang.String,​java.lang.String> mutableNamespaces()
        Map of language to laguage dependent namespace identifier.

        namespace <key> <value>

        Returns:
        The mutable namespaces container
      • getNamespaces

        public java.util.Map<java.lang.String,​java.lang.String> getNamespaces()
        Map of language to laguage dependent namespace identifier.

        namespace <key> <value>

        Specified by:
        getNamespaces in interface ProgramType_OrBuilder
        Returns:
        The namespaces field value
      • optionalNamespaces

        @Nonnull
        public java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>> optionalNamespaces()
        Map of language to laguage dependent namespace identifier.

        namespace <key> <value>

        Specified by:
        optionalNamespaces in interface ProgramType_OrBuilder
        Returns:
        Optional namespaces field value
      • numNamespaces

        public int numNamespaces()
        Map of language to laguage dependent namespace identifier.

        namespace <key> <value>

        Specified by:
        numNamespaces in interface ProgramType_OrBuilder
        Returns:
        Number of entries in namespaces.
      • setDecl

        @Nonnull
        public ProgramType._Builder setDecl​(java.util.Collection<Declaration> value)
        Set the decl field value.

        List of declarations in the program file. Same order as in the thrift file.

        Parameters:
        value - The new value
        Returns:
        The builder
      • addToDecl

        @Nonnull
        public ProgramType._Builder addToDecl​(Declaration... values)
        Adds entries to the decl list.

        List of declarations in the program file. Same order as in the thrift file.

        Parameters:
        values - The added value
        Returns:
        The builder
      • isSetDecl

        public boolean isSetDecl()
        Checks for explicit presence of the decl field.
        Returns:
        True if decl has been set.
      • hasDecl

        public boolean hasDecl()
        Checks for presence of the decl field.
        Specified by:
        hasDecl in interface ProgramType_OrBuilder
        Returns:
        True if decl is present.
      • isModifiedDecl

        public boolean isModifiedDecl()
        Checks if the decl field has been modified since the builder was created.
        Returns:
        True if decl has been modified.
      • clearDecl

        @Nonnull
        public ProgramType._Builder clearDecl()
        Clear the decl field.
        Returns:
        The builder
      • mutableDecl

        public java.util.List<Declaration> mutableDecl()
        List of declarations in the program file. Same order as in the thrift file.
        Returns:
        The mutable decl container
      • getDecl

        public java.util.List<Declaration> getDecl()
        List of declarations in the program file. Same order as in the thrift file.
        Specified by:
        getDecl in interface ProgramType_OrBuilder
        Returns:
        The decl field value
      • optionalDecl

        @Nonnull
        public java.util.Optional<java.util.List<Declaration>> optionalDecl()
        List of declarations in the program file. Same order as in the thrift file.
        Specified by:
        optionalDecl in interface ProgramType_OrBuilder
        Returns:
        Optional decl field value
      • numDecl

        public int numDecl()
        List of declarations in the program file. Same order as in the thrift file.
        Specified by:
        numDecl in interface ProgramType_OrBuilder
        Returns:
        Number of entries in decl.
      • 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<ProgramType>
        Parameters:
        key - The field key.
        Returns:
        The field builder.
      • set

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

        @Nonnull
        public ProgramType._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<ProgramType>
        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<ProgramType>
        Returns:
        True for a valid message.
      • validate

        public ProgramType._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<ProgramType>
        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.