Class CField

  • All Implemented Interfaces:
    net.morimekta.providence.descriptor.PField, CAnnotatedDescriptor
    Direct Known Subclasses:
    CConst

    public class CField
    extends java.lang.Object
    implements net.morimekta.providence.descriptor.PField, CAnnotatedDescriptor
    Description of a single contained field. Part of the message descriptor.
    • Constructor Summary

      Constructors 
      Constructor Description
      CField​(java.lang.String docs, int id, net.morimekta.providence.descriptor.PRequirement requirement, java.lang.String name, net.morimekta.providence.descriptor.PDescriptorProvider typeProvider, net.morimekta.providence.descriptor.PValueProvider defaultValue, java.util.Map<java.lang.String,java.lang.String> annotations)  
    • Constructor Detail

      • CField

        public CField​(@Nullable
                      java.lang.String docs,
                      int id,
                      @Nonnull
                      net.morimekta.providence.descriptor.PRequirement requirement,
                      @Nonnull
                      java.lang.String name,
                      @Nonnull
                      net.morimekta.providence.descriptor.PDescriptorProvider typeProvider,
                      @Nullable
                      net.morimekta.providence.descriptor.PValueProvider defaultValue,
                      @Nullable
                      java.util.Map<java.lang.String,java.lang.String> annotations)
    • Method Detail

      • getDocumentation

        public java.lang.String getDocumentation()
        Description copied from interface: CAnnotatedDescriptor
        The type comment is the last block of comment written before the type declaration. Comments on the same line, after the declaration is ignored.
        Specified by:
        getDocumentation in interface CAnnotatedDescriptor
        Returns:
        The comment string containing all formatting (not including the comment delimiter and the leading space.
      • getId

        public int getId()
        Specified by:
        getId in interface net.morimekta.providence.descriptor.PField
      • getRequirement

        @Nonnull
        public net.morimekta.providence.descriptor.PRequirement getRequirement()
        Specified by:
        getRequirement in interface net.morimekta.providence.descriptor.PField
      • getType

        @Nonnull
        public net.morimekta.providence.PType getType()
        Specified by:
        getType in interface net.morimekta.providence.descriptor.PField
      • getDescriptor

        @Nonnull
        public net.morimekta.providence.descriptor.PDescriptor getDescriptor()
        Specified by:
        getDescriptor in interface net.morimekta.providence.descriptor.PField
      • getName

        @Nonnull
        public java.lang.String getName()
        Specified by:
        getName in interface net.morimekta.providence.descriptor.PField
      • hasDefaultValue

        public boolean hasDefaultValue()
        Specified by:
        hasDefaultValue in interface net.morimekta.providence.descriptor.PField
      • getDefaultValue

        public java.lang.Object getDefaultValue()
        Specified by:
        getDefaultValue in interface net.morimekta.providence.descriptor.PField
      • hasAnnotation

        public boolean hasAnnotation​(@Nonnull
                                     java.lang.String name)
        Description copied from interface: CAnnotatedDescriptor
        Get the given annotation value.
        Specified by:
        hasAnnotation in interface CAnnotatedDescriptor
        Parameters:
        name - Name of annotation.
        Returns:
        If the annotation is present.
      • getAnnotationValue

        public java.lang.String getAnnotationValue​(@Nonnull
                                                   java.lang.String name)
        Description copied from interface: CAnnotatedDescriptor
        Get the given annotation value.
        Specified by:
        getAnnotationValue in interface CAnnotatedDescriptor
        Parameters:
        name - Name of annotation.
        Returns:
        The annotation value or null.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • 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