Class PrimitiveType


  • public final class PrimitiveType
    extends Type
    Represents a primitive Java type. While a set of constants is provided for easy of use, instance equality should not be used to compare to them. Instead equals(Object) should be used.

    A primitive is considered equal to another primitive if it specifies the same primitive enumeration value, and contains an equal set of annotation instances.

    Since:
    2.0
    • Method Detail

      • kind

        public Type.Kind kind()
        Description copied from class: Type
        Returns the kind of Type this is.
        Specified by:
        kind in class Type
        Returns:
        the kind
      • primitive

        public PrimitiveType.Primitive primitive()
        The type of primitive this primitive type represents
        Returns:
        the primitive
      • equals

        public boolean equals​(java.lang.Object o)
        Description copied from class: Type
        Compares this Type with another type, and returns true if they are equivalent. A type is equivalent to another type if it is the same kind, and all of its fields are equal. This includes annotations, which must be equal as well.
        Overrides:
        equals in class Type
        Parameters:
        o - the type to compare to
        Returns:
        true if equal
        See Also:
        Object.equals(Object)
      • hashCode

        public int hashCode()
        Description copied from class: Type
        Computes a hash code representing this type.
        Overrides:
        hashCode in class Type
        Returns:
        the hash code
      • toCode

        char toCode()
      • decode

        static PrimitiveType decode​(java.lang.String name)
      • fromOridinal

        static PrimitiveType fromOridinal​(int ordinal)