Package org.springframework.geode.pdx
Class ObjectPdxInstanceAdapter
java.lang.Object
org.springframework.geode.pdx.ObjectPdxInstanceAdapter
- All Implemented Interfaces:
Serializable
,org.apache.geode.cache.Document
,org.apache.geode.pdx.PdxInstance
- Since:
- 1.3.0
- See Also:
-
PropertyDescriptor
Field
PdxInstance
WritablePdxInstance
BeanWrapper
PropertyAccessor
PropertyAccessorFactory
- Serialized Form
-
Field Summary
Fields inherited from interface org.apache.geode.cache.Document
FIELD_NOT_FOUND
-
Constructor Summary
ConstructorDescriptionObjectPdxInstanceAdapter
(Object target) Constructs a new instance ofObjectPdxInstanceAdapter
initialized with the givenObject
. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.geode.pdx.WritablePdxInstance
static ObjectPdxInstanceAdapter
Factory method used to construct a new instance of theObjectPdxInstanceAdapter
from the given targetObject
.protected org.springframework.beans.BeanWrapper
Returns theClass.getName()
of the underlying, targetObject
.Returns thevalue
for theproperty
identified by the givenfield name
on the underlying, targetObject
.Returns the targetObject
being adapted by thisPdxInstance
.boolean
boolean
Determines whether thisPdxInstance
can be deserialized back into anObject
.boolean
isEnum()
boolean
isIdentityField
(String fieldName) Determines whether the givenfield name
is an identifier for thisPdxInstance
.static Object
unwrap
(org.apache.geode.pdx.PdxInstance pdxInstance) Null-safe factory method used to unwrap the givenPdxInstance
, returning the underlying, targetObject
upon which thisPdxInstance
is based.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.geode.cache.Document
foreach, getAndCheckField
Methods inherited from interface org.apache.geode.pdx.PdxInstance
equals, hashCode, toString
-
Field Details
-
CLASS_PROPERTY_NAME
- See Also:
-
ID_PROPERTY_NAME
- See Also:
-
-
Constructor Details
-
ObjectPdxInstanceAdapter
Constructs a new instance ofObjectPdxInstanceAdapter
initialized with the givenObject
.- Parameters:
target
-Object
to adapt as aPdxInstance
; must not be null.- Throws:
IllegalArgumentException
- ifObject
is null.- See Also:
-
-
Method Details
-
from
Factory method used to construct a new instance of theObjectPdxInstanceAdapter
from the given targetObject
.- Parameters:
target
-Object
to adapt as aPdxInstance
; must not be null.- Returns:
- a new instance of
ObjectPdxInstanceAdapter
. - Throws:
IllegalArgumentException
- ifObject
is null.- See Also:
-
unwrap
Null-safe factory method used to unwrap the givenPdxInstance
, returning the underlying, targetObject
upon which thisPdxInstance
is based.- Parameters:
pdxInstance
-PdxInstance
to unwrap.- Returns:
- the underlying, target
Object
from the givenPdxInstance
. - See Also:
-
PdxInstance
-
getBeanWrapper
@NonNull protected org.springframework.beans.BeanWrapper getBeanWrapper()Returns aBeanWrapper
wrapping the targetObject
in order to access theObject
as a Java bean using JavaBeans conventions.- Returns:
- a
BeanWrapper
for the targetObject
; never null. - See Also:
-
BeanWrapper
-
getClassName
Returns theClass.getName()
of the underlying, targetObject
.- Specified by:
getClassName
in interfaceorg.apache.geode.pdx.PdxInstance
- Returns:
- the
Class.getName()
of the underlying, targetObject
. - See Also:
-
isDeserializable
public boolean isDeserializable()Determines whether thisPdxInstance
can be deserialized back into anObject
. This method effectively returns true since thisPdxInstance
implementation is an adapter for an underlying, targetObject
in the first place.- Specified by:
isDeserializable
in interfaceorg.apache.geode.pdx.PdxInstance
- Returns:
- a boolean value indicating whether this
PdxInstance
can be deserialized back into anObject
. - See Also:
-
isEnum
public boolean isEnum()- Specified by:
isEnum
in interfaceorg.apache.geode.pdx.PdxInstance
- Returns:
- a boolean value indicating whether the underlying, target
Object
is anenumerated value
type
. - See Also:
-
getField
Returns thevalue
for theproperty
identified by the givenfield name
on the underlying, targetObject
.- Specified by:
getField
in interfaceorg.apache.geode.cache.Document
- Specified by:
getField
in interfaceorg.apache.geode.pdx.PdxInstance
- Parameters:
fieldName
-String
containing the name of the field to get thevalue
for.- Returns:
- the
value
for theproperty
identified by the givenfield name
on the underlying, targetObject
. - See Also:
-
PropertyAccessor.getPropertyValue(String)
getBeanWrapper()
-
getFieldNames
- Specified by:
getFieldNames
in interfaceorg.apache.geode.cache.Document
- Returns:
- a
List
offield names
/properties
serialized in the PDX bytes for the underlying, targetObject
. - See Also:
-
BeanWrapper.getPropertyDescriptors()
PropertyDescriptor
getBeanWrapper()
-
isIdentityField
Determines whether the givenfield name
is an identifier for thisPdxInstance
.- Specified by:
isIdentityField
in interfaceorg.apache.geode.pdx.PdxInstance
- Parameters:
fieldName
-String
containing the name of the field to evaluate.- Returns:
- a boolean value indicating whether the given
field name
is an identifier for thisPdxInstance
. - See Also:
-
resolveIdentityFieldNameFromProperty(BeanWrapper)
-
getObject
Returns the targetObject
being adapted by thisPdxInstance
. -
createWriter
public org.apache.geode.pdx.WritablePdxInstance createWriter()- Specified by:
createWriter
in interfaceorg.apache.geode.pdx.PdxInstance
-
hasField
- Specified by:
hasField
in interfaceorg.apache.geode.cache.Document
- Parameters:
fieldName
-String
containing the name of the field to match against aproperty
from the underlying, targetObject
.- Returns:
- a boolean value that determines whether the given
field name
is aproperty
on the underlying, targetObject
. - See Also:
-