RawType (Oracle - Berkeley DB Java API)
Date: 2017-04-13

com.sleepycat.persist.raw

## Interface RawType

-     public interface RawType

  The type definition for a simple or complex persistent type, or an array of persistent types.

  `RawType` objects are thread-safe. Multiple threads may safely call the methods of a shared `RawType` object.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `ClassMetadata` | `getClassMetadata()` Returns the original model class metadata used to create this class, or null if this is not a model class.
    `java.lang.String` | `getClassName()` Returns the class name for this type in the format specified by `Class.getName()`.
    `RawType` | `getComponentType()` Returns the array component type, or null if this is not an array type.
    `int` | `getDimensions()` Returns the number of array dimensions, or zero if this is not an array type.
    `EntityMetadata` | `getEntityMetadata()` Returns the original model entity metadata used to create this class, or null if this is not an entity class.
    `java.util.List<java.lang.String>` | `getEnumConstants()` Returns an unmodifiable list of the names of the enum instances, or null if this is not an enum type.
    `java.util.Map<java.lang.String,RawField>` | `getFields()` Returns a map of field name to raw field for each non-static non-transient field declared in this class, or null if this is not a complex type (in other words, this is a simple type or an array type).
    `int` | `getId()` Returns the internal unique ID for this type.
    `RawType` | `getSuperType()` Returns the type of the superclass, or null if the superclass is Object or this is not a complex type (in other words, this is a simple type or an array type).
    `int` | `getVersion()` Returns the class version for this type.
    `boolean` | `isArray()` Returns whether this is an array type.
    `boolean` | `isDeleted()` Returns whether this type has been deleted using a class `Deleter` mutation.
    `boolean` | `isEnum()` Returns whether this is an enum type.
    `boolean` | `isPrimitive()` Returns whether this type is a Java primitive: char, byte, short, int, long, float or double.
    `boolean` | `isSimple()` Returns whether this is a simple type: primitive, primitive wrapper, BigInteger, BigDecimal, String or Date.
    `java.lang.String` | `toString()` Returns an XML representation of the raw type.

- - ### Method Detail

    - #### getClassName

          java.lang.String getClassName()

      Returns the class name for this type in the format specified by `Class.getName()`.

      If this class currently exists (has not been removed or renamed) then the class name may be passed to `Class.forName(java.lang.String)` to get the current `Class` object. However, if this raw type is not the current version of the class, this type information may differ from that of the current `Class`.

      Returns:
        the class name.

    - #### getVersion

          int getVersion()

      Returns the class version for this type. For simple types, zero is always returned.
      Returns:
        the version.
      See Also:
        `Entity.version()`, `Persistent.version()`

    - #### getId

          int getId()

      Returns the internal unique ID for this type.
      Returns:
        the ID.

    - #### isSimple

          boolean isSimple()

      Returns whether this is a simple type: primitive, primitive wrapper, BigInteger, BigDecimal, String or Date.

      If true is returned, `isPrimitive()` can be called for more information, and a raw value of this type is represented as a simple type object (not as a `RawObject`).

      If false is returned, this is a complex type, an array type (see `isArray()`), or an enum type, and a raw value of this type is represented as a `RawObject`.

      Returns:
        whether this is a simple type.

    - #### isPrimitive

          boolean isPrimitive()

      Returns whether this type is a Java primitive: char, byte, short, int, long, float or double.

      If true is returned, this is also a simple type. In other words, primitive types are a subset of simple types.

      If true is returned, a raw value of this type is represented as a non-null instance of the primitive type's wrapper class. For example, an `int` raw value is represented as an `Integer`.

      Returns:
        whether this is a Java primitive.

    - #### isEnum

          boolean isEnum()

      Returns whether this is an enum type.

      If true is returned, a value of this type is a `RawObject` and the enum constant String is available via `RawObject.getEnum()`.

      If false is returned, then this is a complex type, an array type (see `isArray()`), or a simple type (see `isSimple()`).

      Returns:
        whether this is a enum type.

    - #### getEnumConstants

          java.util.List<java.lang.String> getEnumConstants()

      Returns an unmodifiable list of the names of the enum instances, or null if this is not an enum type.
      Returns:
        the list of enum names.

    - #### isArray

          boolean isArray()

      Returns whether this is an array type. Raw value arrays are represented as `RawObject` instances.

      If true is returned, the array component type is returned by `getComponentType()` and the number of array dimensions is returned by `getDimensions()`.

      If false is returned, then this is a complex type, an enum type (see `isEnum()`), or a simple type (see `isSimple()`).

      Returns:
        whether this is an array type.

    - #### getDimensions

          int getDimensions()

      Returns the number of array dimensions, or zero if this is not an array type.
      Returns:
        the number of array dimensions, or zero if this is not an array type.

    - #### getComponentType

          RawType getComponentType()

      Returns the array component type, or null if this is not an array type.
      Returns:
        the array component type, or null if this is not an array type.

    - #### getFields

          java.util.Map<java.lang.String,RawField> getFields()

      Returns a map of field name to raw field for each non-static non-transient field declared in this class, or null if this is not a complex type (in other words, this is a simple type or an array type).
      Returns:
        a map of field name to raw field, or null.

    - #### getSuperType

          RawType getSuperType()

      Returns the type of the superclass, or null if the superclass is Object or this is not a complex type (in other words, this is a simple type or an array type).
      Returns:
        the type of the superclass, or null.

    - #### getClassMetadata

          ClassMetadata getClassMetadata()

      Returns the original model class metadata used to create this class, or null if this is not a model class.
      Returns:
        the model class metadata, or null.

    - #### getEntityMetadata

          EntityMetadata getEntityMetadata()

      Returns the original model entity metadata used to create this class, or null if this is not an entity class.
      Returns:
        the model entity metadata, or null.

    - #### isDeleted

          boolean isDeleted()

      Returns whether this type has been deleted using a class `Deleter` mutation. A deleted type may be returned by `EntityModel.getRawTypeVersion` or `EntityModel.getAllRawTypeVersions`.
      Returns:
        whether this type has been deleted.

    - #### toString

          java.lang.String toString()

      Returns an XML representation of the raw type.
      Overrides:
        `toString` in class `java.lang.Object`

Copyright (c) 1996, 2017 Oracle and/or its affiliates. All rights reserved.