Class Declaration

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Declaration>, Decl, Declaration_OrBuilder, net.morimekta.providence.PMessage<Declaration>, net.morimekta.providence.PMessageOrBuilder<Declaration>, net.morimekta.providence.PUnion<Declaration>, net.morimekta.providence.PValue<Declaration>, net.morimekta.providence.serializer.binary.BinaryWriter, net.morimekta.util.Stringable

    @Generated(value="net.morimekta.providence:providence-generator-java",
               comments="java:serializable")
    @Immutable
    public class Declaration
    extends java.lang.Object
    implements Decl, Declaration_OrBuilder, net.morimekta.providence.PUnion<Declaration>, java.lang.Comparable<Declaration>, java.io.Serializable, net.morimekta.providence.serializer.binary.BinaryWriter
    ( <enum> | <typedef> | <struct> | <service> | <const> )
    See Also:
    Serialized Form
    • Field Detail

      • kDescriptor

        public static final net.morimekta.providence.descriptor.PUnionDescriptor<Declaration> kDescriptor
    • Method Detail

      • withDeclEnum

        @Nonnull
        public static Declaration withDeclEnum​(@Nonnull
                                               EnumType_OrBuilder value)
        Parameters:
        value - The union value
        Returns:
        The created union.
      • withDeclTypedef

        @Nonnull
        public static Declaration withDeclTypedef​(@Nonnull
                                                  TypedefType_OrBuilder value)
        Parameters:
        value - The union value
        Returns:
        The created union.
      • withDeclMessage

        @Nonnull
        public static Declaration withDeclMessage​(@Nonnull
                                                  MessageType_OrBuilder value)
        Parameters:
        value - The union value
        Returns:
        The created union.
      • withDeclService

        @Nonnull
        public static Declaration withDeclService​(@Nonnull
                                                  ServiceType_OrBuilder value)
        Parameters:
        value - The union value
        Returns:
        The created union.
      • withDeclConst

        @Nonnull
        public static Declaration withDeclConst​(@Nonnull
                                                ConstType_OrBuilder value)
        Parameters:
        value - The union value
        Returns:
        The created union.
      • asDecl

        public Decl asDecl()
        Returns:
        The union field as implemented type.
      • getDocumentation

        public java.lang.String getDocumentation()
        Documentation for the specific declaration.
        Specified by:
        getDocumentation in interface Decl
        Returns:
        The documentation value.
      • optionalDocumentation

        @Nonnull
        public java.util.Optional<java.lang.String> optionalDocumentation()
        Documentation for the specific declaration.
        Specified by:
        optionalDocumentation in interface Decl
        Returns:
        Optional documentation value.
      • hasDocumentation

        public boolean hasDocumentation()
        Specified by:
        hasDocumentation in interface Decl
        Returns:
        If documentation is present.
      • getName

        @Nonnull
        public java.lang.String getName()
        Name of the type, constant or service.
        Specified by:
        getName in interface Decl
        Returns:
        The name value.
      • hasName

        public boolean hasName()
        Specified by:
        hasName in interface Decl
        Returns:
        If name is present.
      • has

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

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

        public boolean unionFieldIsSet()
        Specified by:
        unionFieldIsSet in interface net.morimekta.providence.PUnion<Declaration>
      • unionField

        @Nonnull
        public Declaration._Field unionField()
        Specified by:
        unionField in interface net.morimekta.providence.PUnion<Declaration>
      • 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
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • asString

        @Nonnull
        public java.lang.String asString()
        Specified by:
        asString in interface net.morimekta.providence.PMessage<Declaration>
        Specified by:
        asString in interface net.morimekta.util.Stringable
      • compareTo

        public int compareTo​(Declaration other)
        Specified by:
        compareTo in interface java.lang.Comparable<Declaration>
      • writeBinary

        public int writeBinary​(net.morimekta.util.io.BigEndianBinaryWriter writer)
                        throws java.io.IOException
        Specified by:
        writeBinary in interface net.morimekta.providence.serializer.binary.BinaryWriter
        Throws:
        java.io.IOException
      • provider

        @Nonnull
        public static net.morimekta.providence.descriptor.PUnionDescriptorProvider<Declaration> provider()
      • descriptor

        @Nonnull
        public net.morimekta.providence.descriptor.PUnionDescriptor<Declaration> descriptor()
        Specified by:
        descriptor in interface net.morimekta.providence.PMessageOrBuilder<Declaration>
        Specified by:
        descriptor in interface net.morimekta.providence.PValue<Declaration>
      • builder

        public static Declaration._Builder builder()
        Make a p_model.Declaration builder.
        Returns:
        The builder instance.