Berkeley DB
version 5.3.28

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
 ClassMetadata getClassMetadata()
          Returns the original model class metadata used to create this class, or null if this is not a model class.
 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.
 List<String> getEnumConstants()
          Returns an unmodifiable list of the names of the enum instances, or null if this is not an enum type.
 Map<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.
 String toString()
          Returns an XML representation of the raw type.
 

Method Detail

getClassName

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.


getVersion

int getVersion()
Returns the class version for this type. For simple types, zero is always returned.

See Also:
Entity.version(), Persistent.version()

getId

int getId()
Returns the internal unique ID for this type.


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.


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.


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()).


getEnumConstants

List<String> getEnumConstants()
Returns an unmodifiable list of the names of the enum instances, or null if this is not an enum type.


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()).


getDimensions

int getDimensions()
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.


getFields

Map<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).


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).


getClassMetadata

ClassMetadata getClassMetadata()
Returns the original model class metadata used to create this class, or null if this is not a model class.


getEntityMetadata

EntityMetadata getEntityMetadata()
Returns the original model entity metadata used to create this class, or null if this is not an entity class.


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.


toString

String toString()
Returns an XML representation of the raw type.

Overrides:
toString in class Object

Berkeley DB
version 5.3.28

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