Class ProgramType._Builder

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

    public static class ProgramType._Builder
    extends net.morimekta.providence.PMessageBuilder<ProgramType,​ProgramType._Field>
    implements net.morimekta.providence.serializer.binary.BinaryReader
    <namespace>* <include>* <declataion>*
    • Constructor Detail

      • _Builder

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

        public _Builder​(ProgramType base)
        Make a mutating builder off a base pmodel.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 presence of the documentation field.
        Returns:
        True if documentation has been set.
      • 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.
        Returns:
        The 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 presence of the program_name field.
        Returns:
        True if program_name has been set.
      • 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.
        Returns:
        The program_name field value
      • setIncludes

        @Nonnull
        public ProgramType._Builder setIncludes​(java.util.Collection<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
      • addToIncludes

        @Nonnull
        public ProgramType._Builder addToIncludes​(java.lang.String... values)
        Adds entries to the includes list.

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

        include "<program>.thrift"

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

        public boolean isSetIncludes()
        Checks for presence of the includes field.
        Returns:
        True if includes has been set.
      • 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.List<java.lang.String> mutableIncludes()
        List of included thrift files. Same as from the actual thrift file.

        include "<program>.thrift"

        Returns:
        The mutable includes container
      • 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 presence of the namespaces field.
        Returns:
        True if namespaces has been set.
      • 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
      • 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 presence of the decl field.
        Returns:
        True if decl has been set.
      • 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
      • 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,​ProgramType._Field>
      • isSet

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

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

        public void validate()
        Specified by:
        validate in class net.morimekta.providence.PMessageBuilder<ProgramType,​ProgramType._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 ProgramType build()
        Specified by:
        build in interface net.morimekta.providence.PBuilder<ProgramType>