public class RawObject
extends java.lang.Object
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 | Description |
---|---|
RawObject(RawType type,
java.lang.Object[] elements) |
Creates a raw object with the given array elements for an array type.
|
RawObject(RawType type,
java.lang.String enumConstant) |
Creates a raw object with the given enum value for an enum type.
|
RawObject(RawType type,
java.util.Map<java.lang.String,java.lang.Object> values,
RawObject superObject) |
Creates a raw object with a given set of field values for a complex
type.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals(java.lang.Object other) |
|
java.lang.Object[] |
getElements() |
Returns the array of elements for an array type, or null for a complex
type or an enum type.
|
java.lang.String |
getEnum() |
Returns the enum constant String for an enum type, or null for a complex
type or an array type.
|
RawObject |
getSuper() |
Returns the instance of the superclass, or null if the superclass is
Object or Enum . |
RawType |
getType() |
Returns the raw type information for this raw object.
|
java.util.Map<java.lang.String,java.lang.Object> |
getValues() |
Returns a map of field name to value for a complex type, or null for an
array type or an enum type.
|
int |
hashCode() |
|
java.lang.String |
toString() |
Returns an XML representation of the raw object.
|
public RawObject(RawType type, java.util.Map<java.lang.String,java.lang.Object> values, RawObject superObject)
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 a
RawObject
, a simple
type instance, or null.superObject
- the instance of the superclass, or null if the
superclass is Object
.java.lang.IllegalArgumentException
- if the type argument is an array type.public RawObject(RawType type, java.lang.Object[] elements)
type
- the type of this raw object.elements
- an array of elements. Each element in the array is a
RawObject
, a simple
type instance, or null.java.lang.IllegalArgumentException
- if the type argument is not an array
type.public RawObject(RawType type, java.lang.String enumConstant)
type
- the type of this raw object.enumConstant
- the String value of this enum constant; must be
one of the Strings returned by RawType.getEnumConstants()
.java.lang.IllegalArgumentException
- if the type argument is not an array
type.public RawType getType()
Note that if this object is unevolved, the returned type may be
different from the current type returned by EntityModel.getRawType
for the same class name.
This can only occur in a Conversion.convert
.
public java.util.Map<java.lang.String,java.lang.Object> getValues()
RawObject
, a simple
type instance, or null.
There will be an entry in the map for every field declared in this
type, as determined by RawType.getFields()
for the type returned
by getType()
. Values in the map may be null for fields with
non-primitive types.
public java.lang.Object[] getElements()
RawObject
,
a simple type instance,
or null.public java.lang.String getEnum()
RawType.getEnumConstants()
.public RawObject getSuper()
Object
or Enum
.public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
Copyright (c) 1996, 2020 Oracle and/or its affiliates. All rights reserved.