oracle.dbtools.plugin.api.types

## Enum Primitive

- java.lang.Object
- - java.lang.Enum<Primitive>
  - - oracle.dbtools.plugin.api.types.Primitive

- All Implemented Interfaces:
    Serializable, Comparable<Primitive>

      public enum Primitive
      extends Enum<Primitive>

  Enumerates the Java primitive types
  Since:
    19.3.0
  Author:
    cdivilly

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `BOOLEAN` The `boolean` type
    `BYTE` The `byte` type
    `CHAR` The `char` type
    `DOUBLE` The `double` type
    `FLOAT` The `float` type
    `INT` The `int` type
    `LONG` The `long` type
    `REFERENCE` A reference to a non primitive type
    `SHORT` The `short` type

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `booleanValue(Object value)` Convert an object instance to a boolean value
    `byte` | `byteValue(Object value)` Convert an object instance to a byte value
    `char` | `charValue(Object value)` Convert an object instance to a char value
    `double` | `doubleValue(Object value)` Convert an object instance to a double value
    `float` | `floatValue(Object value)` Convert an object instance to a float value
    `int` | `intValue(Object value)` Convert an object instance to an int value
    `boolean` | `isPrimitive()` Indicates if this value represents a primitive type.
    `long` | `longValue(Object value)` Convert an object instance to a long value
    `short` | `shortValue(Object value)` Convert an object instance to a short value
    `Class<?>` | `type()` This primtiive type's `Class` instance
    `static Primitive` | `valueOf(Class<?> type)` Determine the appropriate `Primitive` instance for the specified type
    `static Primitive` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static Primitive[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.
    `PrimitiveWrapper` | `wrapper()` Retrieves the equivalent wrapper type for this primitive type
    `Class<?>` | `wrapperType()` The wrapper type associated with this type.

    - ### Methods inherited from class java.lang.Enum

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### 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 Detail

    - #### values

          public static Primitive[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (Primitive c : Primitive.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static Primitive valueOf(String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type 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

Copyright © 2010, 2022, Oracle and/or its affiliates.