Enum Class Primitive

java.lang.Object
java.lang.Enum<Primitive>
oracle.dbtools.plugin.api.types.Primitive
All Implemented Interfaces:
Serializable, Comparable<Primitive>, Constable

public enum Primitive extends Enum<Primitive>
Enumerates the Java primitive types
Since:
19.3.0
Author:
cdivilly
  • Enum Constant Details

    • BOOLEAN

      public static final Primitive BOOLEAN
      The boolean type
    • BYTE

      public static final Primitive BYTE
      The byte type
    • CHAR

      public static final Primitive CHAR
      The char type
    • DOUBLE

      public static final Primitive DOUBLE
      The double type
    • FLOAT

      public static final Primitive FLOAT
      The float type
    • INT

      public static final Primitive INT
      The int type
    • LONG

      public static final Primitive LONG
      The long type
    • REFERENCE

      public static final Primitive REFERENCE
      A reference to a non primitive type
    • SHORT

      public static final Primitive SHORT
      The short type
  • Method Details

    • values

      public static Primitive[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Primitive valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • wrapper

      public PrimitiveWrapper wrapper()
      Retrieves the equivalent wrapper type for this primitive type
      Returns:
      The PrimitiveWrapper type for this type
    • booleanValue

      public boolean booleanValue(Object value)
      Convert an object instance to a boolean value
      Parameters:
      value - The value to cast
      Returns:
      The boolean representation
    • byteValue

      public byte byteValue(Object value)
      Convert an object instance to a byte value
      Parameters:
      value - The value to cast
      Returns:
      The byte representation
    • charValue

      public char charValue(Object value)
      Convert an object instance to a char value
      Parameters:
      value - The value to cast
      Returns:
      The char representation
    • doubleValue

      public double doubleValue(Object value)
      Convert an object instance to a double value
      Parameters:
      value - The value to cast
      Returns:
      The double representation
    • floatValue

      public float floatValue(Object value)
      Convert an object instance to a float value
      Parameters:
      value - The value to cast
      Returns:
      The float representation
    • intValue

      public int intValue(Object value)
      Convert an object instance to an int value
      Parameters:
      value - The value to cast
      Returns:
      The int representation
    • isPrimitive

      public final boolean isPrimitive()
      Indicates if this value represents a primitive type.
      Returns:
      false if this is an instance of REFERENCE, true otherwise
    • longValue

      public long longValue(Object value)
      Convert an object instance to a long value
      Parameters:
      value - The value to cast
      Returns:
      The long representation
    • shortValue

      public short shortValue(Object value)
      Convert an object instance to a short value
      Parameters:
      value - The value to cast
      Returns:
      The short representation
    • wrapperType

      public Class<?> wrapperType()
      The wrapper type associated with this type. For example the wrapper type for int is Integer
      Returns:
      The wrapper type for this primitive type
    • type

      public Class<?> type()
      This primtiive type's Class instance
      Returns:
      Class instance
    • valueOf

      public static Primitive valueOf(Class<?> type)
      Determine the appropriate Primitive instance for the specified type
      Parameters:
      type - The type to examine
      Returns:
      The corresponding Primitive instance