[private]
.
cache.xml
by setting the attribute read-serialized
to true on the pdx
element. Or it can be done programmatically using the CacheFactory.SetPdxReadSerialized method. Once this preference is configured, then any time deserialization of a PDX is done it will deserialize into a PdxInstance. PdxInstance are immutable. If you want to change one call IPdxInstance.CreateWriter. Public Member Functions | |
IWritablePdxInstance^ | CreateWriter () |
bool | Equals (Object^ other) |
String^ | GetClassName () |
Object^ | GetField (String^ fieldName) |
IList< String^ >^ | GetFieldNames () |
int | GetHashCode () |
Object^ | GetObject () |
bool | HasField (String^ fieldName) |
bool | IsIdentityField (String^ fieldName) |
String^ | ToString () |
IWritablePdxInstance ^ GemStone::GemFire::Cache::Generic::IPdxInstance::CreateWriter | ( | ) |
Creates and returns a IWritablePdxInstance whose initial values are those of this PdxInstance. This call returns a copy of the current field values so modifications made to the returned value will not modify this PdxInstance.
returns> a IWritablePdxInstance
Implemented in GemStone::GemFire::Cache::Generic::Internal::PdxInstanceImpl.
bool GemStone::GemFire::Cache::Generic::IPdxInstance::Equals | ( | Object^ | other | ) |
Returns true if the given object is equals to this instance. If other
is not a PdxInstance then it is not equal to this instance. NOTE: Even if other
is the result of calling GetObject it will notbe equal to this instance. Otherwise equality of two PdxInstances is determined as follows:
If one of the instances does not have a field that the other one does then equals will assume it has the field with a default value. If a PdxInstance has marked identity fields using IPdxWriter.MarkIdentityFieldthen only the marked identity fields are its identity fields. Otherwise all its fields are identity fields. An identity field is equal if all the following are true:
If a field's type is OBJECT
then its value must be deserialized to determine if it is equals. If the deserialized object is an array then all the array element is used to determine equality. Otherwise Object.Equals is used. If a field's type is OBJECT[]
then its value must be deserialized and all the array element is used to determine equality. For all other field types then the value does not need to be deserialized. Instead the serialized raw bytes are compared and used to determine equality. Note that any fields that have objects that do not override Object.Equals will cause equals to return false when you might have expected it to return true. param name="other"> the other instance to compare to this.
returns> true
if this instance is equal to other
.
Implemented in GemStone::GemFire::Cache::Generic::Internal::PdxInstanceImpl.
String ^ GemStone::GemFire::Cache::Generic::IPdxInstance::GetClassName | ( | ) |
Return the full name of the class that this pdx instance represents.
Implemented in GemStone::GemFire::Cache::Generic::Internal::PdxInstanceImpl.
Object ^ GemStone::GemFire::Cache::Generic::IPdxInstance::GetField | ( | String^ | fieldName | ) |
Reads the named field and returns its value. If the field does not exist null
is returned. A null
result indicates that the field does not exist or that it exists and its value is currently null
. The HasField method can be used to figure outwhich if these two cases is true. If an Object[] is deserialized by this call then that array's component type will be Object
instead of the original class that the array had when it was serialized. This is done so that PdxInstance objects can be added to the array.
param name="fieldName"> name of the field to read
returns> If this instance has the named field then the field's value is returned, otherwise null
is returned.
Implemented in GemStone::GemFire::Cache::Generic::Internal::PdxInstanceImpl.
IList<String^> ^ GemStone::GemFire::Cache::Generic::IPdxInstance::GetFieldNames | ( | ) |
Return an list of the field names on this PdxInstance.
Implemented in GemStone::GemFire::Cache::Generic::Internal::PdxInstanceImpl.
int GemStone::GemFire::Cache::Generic::IPdxInstance::GetHashCode | ( | ) |
Generates a hashCode based on the identity fields of this PdxInstance. If a PdxInstance has marked identity fields using IPdxWriter.MarkIdentityField then only the marked identity fields are its identity fields. Otherwise all its fields are identity fields.
If an identity field is of type OBJECT
then it is deserialized. If the deserialized object is an array then all the array element is used. Otherwise Object.GetHashCode is used. If an identity field is of type OBJECT[]
this it is deserialized and all the array element is used. Otherwise the field is not deserialized and the raw bytes of its value are used to compute the hash code.
Implemented in GemStone::GemFire::Cache::Generic::Internal::PdxInstanceImpl.
Object ^ GemStone::GemFire::Cache::Generic::IPdxInstance::GetObject | ( | ) |
Deserializes and returns the domain object that this instance represents.
Implemented in GemStone::GemFire::Cache::Generic::Internal::PdxInstanceImpl.
bool GemStone::GemFire::Cache::Generic::IPdxInstance::HasField | ( | String^ | fieldName | ) |
Checks if the named field exists and returns the result. This can be useful when writing code that handles more than one version of a PDX class. fieldName the name of the field to check
returns> true
if the named field exists; otherwise false
Implemented in GemStone::GemFire::Cache::Generic::Internal::PdxInstanceImpl.
bool GemStone::GemFire::Cache::Generic::IPdxInstance::IsIdentityField | ( | String^ | fieldName | ) |
Checks if the named field was IPdxWriter.MarkIdentityField marked as an identity field. Note that if no fields have been marked then all the fields are used as identity fields even though this method will return false
since none of them have been marked.
param name="fieldName"> the name of the field to check
returns> true
if the named field exists and was marked as an identify field; otherwise false
Implemented in GemStone::GemFire::Cache::Generic::Internal::PdxInstanceImpl.
String ^ GemStone::GemFire::Cache::Generic::IPdxInstance::ToString | ( | ) |
Prints out all of the identity fields of this PdxInstance. If a PdxInstance has marked identity fields using IPdxWriter.MarkIdentityField then only the marked identity fields are its identity fields. Otherwise all its fields are identity fields.
Implemented in GemStone::GemFire::Cache::Generic::Internal::PdxInstanceImpl.