Class ProgramType._Builder

  • All Implemented Interfaces:
    ProgramType_OrBuilder, net.morimekta.providence.PMessageOrBuilder<ProgramType>, net.morimekta.providence.PValue<ProgramType>, net.morimekta.providence.serializer.binary.BinaryReader
    Enclosing class:
    ProgramType

    public static class ProgramType._Builder
    extends net.morimekta.providence.PMessageBuilder<ProgramType>
    implements ProgramType_OrBuilder, net.morimekta.providence.serializer.binary.BinaryReader
    <namespace>* <include>* <declataion>*
    • 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

      • 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 net.morimekta.providence.PMessageBuilder mutator​(int key)
        Specified by:
        mutator in class net.morimekta.providence.PMessageBuilder<ProgramType>
      • set

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

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

        public boolean isModified​(int key)
        Specified by:
        isModified in class net.morimekta.providence.PMessageBuilder<ProgramType>
      • get

        public <T> T get​(int key)
        Specified by:
        get in interface net.morimekta.providence.PMessageOrBuilder<ProgramType>
      • has

        public boolean has​(int key)
        Specified by:
        has in interface net.morimekta.providence.PMessageOrBuilder<ProgramType>
      • addTo

        @Nonnull
        public ProgramType._Builder addTo​(int key,
                                          java.lang.Object value)
        Specified by:
        addTo in class net.morimekta.providence.PMessageBuilder<ProgramType>
      • valid

        public boolean valid()
        Specified by:
        valid in class net.morimekta.providence.PMessageBuilder<ProgramType>
      • descriptor

        @Nonnull
        public net.morimekta.providence.descriptor.PStructDescriptor<ProgramType> descriptor()
        Specified by:
        descriptor in interface net.morimekta.providence.PMessageOrBuilder<ProgramType>
        Specified by:
        descriptor in interface net.morimekta.providence.PValue<ProgramType>
      • 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

        @Nonnull
        public ProgramType build()
        Specified by:
        build in class net.morimekta.providence.PMessageBuilder<ProgramType>