Class Declaration

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

    @Generated("providence-maven-plugin")
    @Immutable
    public class Declaration
    extends java.lang.Object
    implements net.morimekta.providence.PUnion<Declaration,Declaration._Field>, java.lang.Comparable<Declaration>, java.io.Serializable, net.morimekta.providence.serializer.binary.BinaryWriter
    ( <enum> | <typedef> | <struct> | <service> | <const> )
    See Also:
    Serialized Form
    • Method Detail

      • withDeclEnum

        public static Declaration withDeclEnum​(EnumType value)
        Parameters:
        value - The union value
        Returns:
        The created union.
      • withDeclEnum

        public static Declaration withDeclEnum​(EnumType._Builder value)
        Parameters:
        value - The union value
        Returns:
        The created union.
      • withDeclTypedef

        public static Declaration withDeclTypedef​(TypedefType value)
        Parameters:
        value - The union value
        Returns:
        The created union.
      • withDeclTypedef

        public static Declaration withDeclTypedef​(TypedefType._Builder value)
        Parameters:
        value - The union value
        Returns:
        The created union.
      • withDeclMessage

        public static Declaration withDeclMessage​(MessageType value)
        Parameters:
        value - The union value
        Returns:
        The created union.
      • withDeclMessage

        public static Declaration withDeclMessage​(MessageType._Builder value)
        Parameters:
        value - The union value
        Returns:
        The created union.
      • withDeclService

        public static Declaration withDeclService​(ServiceType value)
        Parameters:
        value - The union value
        Returns:
        The created union.
      • withDeclService

        public static Declaration withDeclService​(ServiceType._Builder value)
        Parameters:
        value - The union value
        Returns:
        The created union.
      • withDeclConst

        public static Declaration withDeclConst​(ConstType value)
        Parameters:
        value - The union value
        Returns:
        The created union.
      • withDeclConst

        public static Declaration withDeclConst​(ConstType._Builder value)
        Parameters:
        value - The union value
        Returns:
        The created union.
      • hasDeclEnum

        public boolean hasDeclEnum()
      • getDeclEnum

        public EnumType getDeclEnum()
        Returns:
        The decl_enum value
      • optionalDeclEnum

        @Nonnull
        public java.util.Optional<EnumType> optionalDeclEnum()
        Returns:
        Optional of the decl_enum field value.
      • hasDeclTypedef

        public boolean hasDeclTypedef()
      • getDeclTypedef

        public TypedefType getDeclTypedef()
        Returns:
        The decl_typedef value
      • optionalDeclTypedef

        @Nonnull
        public java.util.Optional<TypedefType> optionalDeclTypedef()
        Returns:
        Optional of the decl_typedef field value.
      • hasDeclMessage

        public boolean hasDeclMessage()
      • getDeclMessage

        public MessageType getDeclMessage()
        Returns:
        The decl_message value
      • optionalDeclMessage

        @Nonnull
        public java.util.Optional<MessageType> optionalDeclMessage()
        Returns:
        Optional of the decl_message field value.
      • hasDeclService

        public boolean hasDeclService()
      • getDeclService

        public ServiceType getDeclService()
        Returns:
        The decl_service value
      • optionalDeclService

        @Nonnull
        public java.util.Optional<ServiceType> optionalDeclService()
        Returns:
        Optional of the decl_service field value.
      • hasDeclConst

        public boolean hasDeclConst()
      • getDeclConst

        public ConstType getDeclConst()
        Returns:
        The decl_const value
      • optionalDeclConst

        @Nonnull
        public java.util.Optional<ConstType> optionalDeclConst()
        Returns:
        Optional of the decl_const field value.
      • unionFieldIsSet

        public boolean unionFieldIsSet()
        Specified by:
        unionFieldIsSet in interface net.morimekta.providence.PUnion<Declaration,Declaration._Field>
      • 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,Declaration._Field>
        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
      • builder

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