Package com.sleepycat.persist.raw
Class RawObject
java.lang.Object
com.sleepycat.persist.raw.RawObject
A raw instance that can be used with a
RawStore or Conversion. A RawObject is used to represent instances of
complex types (persistent classes with fields), arrays, and enum values. It
is not used to represent non-enum simple types, which are represented as
simple objects. This includes primitives, which are represented as
instances of their wrapper class.
RawObject objects are thread-safe. Multiple threads may safely
call the methods of a shared RawObject object.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a raw object with the given array elements for an array type.Creates a raw object with the given enum value for an enum type.Creates a raw object with a given set of field values for a complex type. -
Method Summary
Modifier and TypeMethodDescriptionbooleanObject[]Returns the array of elements for an array type, or null for a complex type or an enum type.getEnum()Returns the enum constant String for an enum type, or null for a complex type or an array type.getSuper()Returns the instance of the superclass, or null if the superclass isObjectorEnum.getType()Returns the raw type information for this raw object.Returns a map of field name to value for a complex type, or null for an array type or an enum type.inthashCode()toString()Returns an XML representation of the raw object.
-
Constructor Details
-
RawObject
Creates a raw object with a given set of field values for a complex type.- Parameters:
type- the type of this raw object.values- a map of field name to value for each declared field in the class, or null to create an empty map. Each value in the map is aRawObject, a invalid input: '{@link <a href="../model/Entity.html#simpleTypes">simple' type} instance, or null.superObject- the instance of the superclass, or null if the superclass isObject.- Throws:
IllegalArgumentException- if the type argument is an array type.
-
RawObject
Creates a raw object with the given array elements for an array type.- Parameters:
type- the type of this raw object.elements- an array of elements. Each element in the array is aRawObject, a invalid input: '{@link <a href="../model/Entity.html#simpleTypes">simple' type} instance, or null.- Throws:
IllegalArgumentException- if the type argument is not an array type.
-
RawObject
Creates a raw object with the given enum value for an enum type.- Parameters:
type- the type of this raw object.enumConstant- the String value of this enum constant; must be one of the Strings returned byRawType.getEnumConstants().- Throws:
IllegalArgumentException- if the type argument is not an array type.
-
-
Method Details
-
getType
Returns the raw type information for this raw object.Note that if this object is unevolved, the returned type may be different from the current type returned by
EntityModel.getRawTypefor the same class name. This can only occur in aConversion.convert. -
getValues
Returns a map of field name to value for a complex type, or null for an array type or an enum type. The map contains a String key for each declared field in the class. Each value in the map is aRawObject, atype} instance, or null.invalid @link
{@link <a href="../model/Entity.html#simpleTypes">simpleThere will be an entry in the map for every field declared in this type, as determined by
RawType.getFields()for the type returned bygetType(). Values in the map may be null for fields with non-primitive types. -
getElements
Returns the array of elements for an array type, or null for a complex type or an enum type. Each element in the array is aRawObject, atype} instance, or null.invalid @link
{@link <a href="../model/Entity.html#simpleTypes">simple -
getEnum
Returns the enum constant String for an enum type, or null for a complex type or an array type. The String returned will be one of the Strings returned byRawType.getEnumConstants(). -
getSuper
Returns the instance of the superclass, or null if the superclass isObjectorEnum. -
equals
-
hashCode
public int hashCode() -
toString
Returns an XML representation of the raw object.
-