Class FieldType

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

    @Generated(value="net.morimekta.providence:providence-generator-java",
               comments="java:serializable")
    @Immutable
    public class FieldType
    extends java.lang.Object
    implements Decl, FieldType_OrBuilder, net.morimekta.providence.PMessage<FieldType>, java.lang.Comparable<FieldType>, java.io.Serializable, net.morimekta.providence.serializer.binary.BinaryWriter
    For fields: (<key>:)? (required|optional)? <type> <name> (= <default_value>)? For const: const <type> <name> = <default_value>

    Fields without key is assigned values ranging from 65335 and down (2^16-1) in order of appearance. Because of the "in order of appearance" the field *must* be filled by the IDL parser.

    Consts are always given the key '0'.

    See Also:
    Serialized Form
    • Field Detail

      • kDescriptor

        public static final net.morimekta.providence.descriptor.PStructDescriptor<FieldType> kDescriptor
    • Method Detail

      • hasDocumentation

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

        public java.lang.String getDocumentation()
        Description copied from interface: Decl
        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()
        Description copied from interface: Decl
        Documentation for the specific declaration.
        Specified by:
        optionalDocumentation in interface Decl
        Returns:
        Optional of the documentation field value.
      • getType

        @Nonnull
        public java.lang.String getType()
        Specified by:
        getType in interface FieldType_OrBuilder
        Returns:
        The type value
      • hasName

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

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

        @Nonnull
        public java.util.Optional<java.lang.String> optionalDefaultValue()
        Specified by:
        optionalDefaultValue in interface FieldType_OrBuilder
        Returns:
        Optional of the default_value field value.
      • getAnnotations

        public java.util.Map<java.lang.String,​java.lang.String> getAnnotations()
        Specified by:
        getAnnotations in interface FieldType_OrBuilder
        Returns:
        The annotations value
      • optionalAnnotations

        @Nonnull
        public java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>> optionalAnnotations()
        Specified by:
        optionalAnnotations in interface FieldType_OrBuilder
        Returns:
        Optional of the annotations field value.
      • has

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

        public <T> T get​(int key)
        Specified by:
        get in interface net.morimekta.providence.PMessageOrBuilder<FieldType>
      • 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<FieldType>
        Specified by:
        asString in interface net.morimekta.util.Stringable
      • compareTo

        public int compareTo​(FieldType other)
        Specified by:
        compareTo in interface java.lang.Comparable<FieldType>
      • 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
      • mutate

        @Nonnull
        public FieldType._Builder mutate()
        Specified by:
        mutate in interface net.morimekta.providence.PMessage<FieldType>
      • provider

        @Nonnull
        public static net.morimekta.providence.descriptor.PStructDescriptorProvider<FieldType> provider()
      • descriptor

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

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