Apache Geode Native .NET Reference 1.15.0
Apache::Geode::Client::IPdxInstanceFactory Interface Reference

PdxInstanceFactory gives you a way to create PdxInstances. More...

#include <IPdxInstanceFactory.hpp>

Public Member Functions

IPdxInstanceCreate ()
 Create a IPdxInstance . More...
 
IPdxInstanceFactoryMarkIdentityField (String^ fieldName)
 Indicate that the named field should be included in hashCode and equals checks of this object on a server that is accessing IPdxInstance or when a client executes a query on a server. More...
 
IPdxInstanceFactoryWriteArrayOfByteArrays (String^ fieldName, array< array< Byte >^>^ value)
 Writes the named field with the given value to the serialized form. More...
 
IPdxInstanceFactoryWriteBoolean (String^ fieldName, Boolean value)
 Writes the named field with the given value to the serialized form. More...
 
IPdxInstanceFactoryWriteBooleanArray (String^ fieldName, array< Boolean >^ value)
 Writes the named field with the given value to the serialized form. More...
 
IPdxInstanceFactoryWriteByte (String^ fieldName, SByte value)
 Writes the named field with the given value to the serialized form. More...
 
IPdxInstanceFactoryWriteByteArray (String^ fieldName, array< Byte >^ value)
 Writes the named field with the given value to the serialized form. More...
 
IPdxInstanceFactoryWriteChar (String^ fieldName, Char value)
 
Writes the named field with the given value to the serialized form. More...
 
IPdxInstanceFactoryWriteCharArray (String^ fieldName, array< Char >^ value)
 Writes the named field with the given value to the serialized form. More...
 
IPdxInstanceFactoryWriteDate (String^ fieldName, System::DateTime value)
 Writes the named field with the given value to the serialized form. More...
 
IPdxInstanceFactoryWriteDouble (String^ fieldName, double value)
 Writes the named field with the given value to the serialized form. More...
 
IPdxInstanceFactoryWriteDoubleArray (String^ fieldName, array< double >^ value)
 Writes the named field with the given value to the serialized form. More...
 
IPdxInstanceFactoryWriteField (String^ fieldName, Object^ fieldValue, Type^ fieldType)
 Writes the named field with the given value and type to the serialized form. More...
 
IPdxInstanceFactoryWriteFloat (String^ fieldName, float value)
 Writes the named field with the given value to the serialized form. More...
 
IPdxInstanceFactoryWriteFloatArray (String^ fieldName, array< float >^ value)
 Writes the named field with the given value to the serialized form. More...
 
IPdxInstanceFactoryWriteInt (String^ fieldName, Int32 value)
 Writes the named field with the given value to the serialized form. More...
 
IPdxInstanceFactoryWriteIntArray (String^ fieldName, array< Int32 >^ value)
 Writes the named field with the given value to the serialized form. More...
 
IPdxInstanceFactoryWriteLong (String^ fieldName, Int64 value)
 Writes the named field with the given value to the serialized form. More...
 
IPdxInstanceFactoryWriteLongArray (String^ fieldName, array< Int64 >^ value)
 Writes the named field with the given value to the serialized form. More...
 
IPdxInstanceFactoryWriteObject (String^ fieldName, Object^ value)
 Writes the named field with the given value to the serialized form. More...
 
IPdxInstanceFactoryWriteObjectArray (String^ fieldName, System::Collections::Generic::List< Object^>^ value)
 Writes the named field with the given value to the serialized form. More...
 
IPdxInstanceFactoryWriteShort (String^ fieldName, Int16 value)
 Writes the named field with the given value to the serialized form. More...
 
IPdxInstanceFactoryWriteShortArray (String^ fieldName, array< Int16 >^ value)
 Writes the named field with the given value to the serialized form. More...
 
IPdxInstanceFactoryWriteString (String^ fieldName, String^ value)
 Writes the named field with the given value to the serialized form. More...
 
IPdxInstanceFactoryWriteStringArray (String^ fieldName, array< String^>^ value)
 Writes the named field with the given value to the serialized form. More...
 

Detailed Description

PdxInstanceFactory gives you a way to create PdxInstances.

Call the write methods to populate the field data and then call Create to produce an actual instance that contains the data. To create a factory call IRegionService.CreatePdxInstanceFactory. A factory can only create a single instance. To create multiple instances create multiple factories or use IPdxInstance.CreateWriter to create subsequent instances.

Member Function Documentation

◆ Create()

IPdxInstance ^ Apache::Geode::Client::IPdxInstanceFactory::Create ( )

Create a IPdxInstance .

The instance will contain any data written to this factory using the write methods.

Returns
the created instance
Exceptions
IllegalStateExceptionif called more than once


◆ MarkIdentityField()

IPdxInstanceFactory ^ Apache::Geode::Client::IPdxInstanceFactory::MarkIdentityField ( String^  fieldName)

Indicate that the named field should be included in hashCode and equals checks of this object on a server that is accessing IPdxInstance or when a client executes a query on a server.

The fields that are marked as identity fields are used to generate the hashCode and equals methods of PdxInstance. Because of this, the identity fields should themselves either be primitives, or implement hashCode and equals.

If no fields are set as identity fields, then all fields will be used in hashCode and equals checks.

The identity fields should make marked after they are written using a write/// method.

Parameters
fieldNamethe name of the field to mark as an identity field.
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has not already been written.

◆ WriteArrayOfByteArrays()

IPdxInstanceFactory ^ Apache::Geode::Client::IPdxInstanceFactory::WriteArrayOfByteArrays ( String^  fieldName,
array< array< Byte >^>^  value 
)

Writes the named field with the given value to the serialized form.

The fields type is byte[][].

Java byte[][] is mapped to .NET System.Byte[][].

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written

◆ WriteBoolean()

IPdxInstanceFactory ^ Apache::Geode::Client::IPdxInstanceFactory::WriteBoolean ( String^  fieldName,
Boolean  value 
)

Writes the named field with the given value to the serialized form.

The fields type is boolean.

Java boolean is mapped to .NET System.Boolean.

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written

◆ WriteBooleanArray()

IPdxInstanceFactory ^ Apache::Geode::Client::IPdxInstanceFactory::WriteBooleanArray ( String^  fieldName,
array< Boolean >^  value 
)

Writes the named field with the given value to the serialized form.

The fields type is boolean[].

Java boolean[] is mapped to .NET System.Boolean[].

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written

◆ WriteByte()

IPdxInstanceFactory ^ Apache::Geode::Client::IPdxInstanceFactory::WriteByte ( String^  fieldName,
SByte  value 
)

Writes the named field with the given value to the serialized form.

The fields type is sbyte.

Java byte is mapped to .NET System.SByte.

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written

◆ WriteByteArray()

IPdxInstanceFactory ^ Apache::Geode::Client::IPdxInstanceFactory::WriteByteArray ( String^  fieldName,
array< Byte >^  value 
)

Writes the named field with the given value to the serialized form.

The fields type is byte[].

Java byte[] is mapped to .NET System.Byte[].

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written

◆ WriteChar()

IPdxInstanceFactory ^ Apache::Geode::Client::IPdxInstanceFactory::WriteChar ( String^  fieldName,
Char  value 
)


Writes the named field with the given value to the serialized form.

The fields type is char.

Java char is mapped to .NET System.Char.

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written

◆ WriteCharArray()

IPdxInstanceFactory ^ Apache::Geode::Client::IPdxInstanceFactory::WriteCharArray ( String^  fieldName,
array< Char >^  value 
)

Writes the named field with the given value to the serialized form.

The fields type is char[].

Java char[] is mapped to .NET System.Char[].

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written

◆ WriteDate()

IPdxInstanceFactory ^ Apache::Geode::Client::IPdxInstanceFactory::WriteDate ( String^  fieldName,
System::DateTime  value 
)

Writes the named field with the given value to the serialized form.

The fields type is Date.

Java Date is mapped to .NET System.DateTime.

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written

◆ WriteDouble()

IPdxInstanceFactory ^ Apache::Geode::Client::IPdxInstanceFactory::WriteDouble ( String^  fieldName,
double  value 
)

Writes the named field with the given value to the serialized form.

The fields type is double.

Java double is mapped to .NET System.Double.

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written

◆ WriteDoubleArray()

IPdxInstanceFactory ^ Apache::Geode::Client::IPdxInstanceFactory::WriteDoubleArray ( String^  fieldName,
array< double >^  value 
)

Writes the named field with the given value to the serialized form.

The fields type is double[].

Java double[] is mapped to .NET System.Double[].

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written

◆ WriteField()

IPdxInstanceFactory ^ Apache::Geode::Client::IPdxInstanceFactory::WriteField ( String^  fieldName,
Object^  fieldValue,
Type^  fieldType 
)

Writes the named field with the given value and type to the serialized form.

This method uses the fieldType to determine which writeXXX method it should call. If it can not find a specific match to a writeXXX method it will call WriteObject. This method may serialize objects that are not portable to non-java languages.

The fieldTypes maps to a specific method.

Parameters
fieldNamethe name of the field to write
Parameters
fieldValuethe value of the field to write; this parameter's class must extend the
fieldType
fieldTypethe type of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written

◆ WriteFloat()

IPdxInstanceFactory ^ Apache::Geode::Client::IPdxInstanceFactory::WriteFloat ( String^  fieldName,
float  value 
)

Writes the named field with the given value to the serialized form.

The fields type is float.

Java float is mapped to .NET System.Single(float).

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written

◆ WriteFloatArray()

IPdxInstanceFactory ^ Apache::Geode::Client::IPdxInstanceFactory::WriteFloatArray ( String^  fieldName,
array< float >^  value 
)

Writes the named field with the given value to the serialized form.

The fields type is float[].

Java float[] is mapped to .NET System.Single[] or float[].

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written

◆ WriteInt()

IPdxInstanceFactory ^ Apache::Geode::Client::IPdxInstanceFactory::WriteInt ( String^  fieldName,
Int32  value 
)

Writes the named field with the given value to the serialized form.

The fields type is int.

Java int is mapped to .NET System.Int32.

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written

◆ WriteIntArray()

IPdxInstanceFactory ^ Apache::Geode::Client::IPdxInstanceFactory::WriteIntArray ( String^  fieldName,
array< Int32 >^  value 
)

Writes the named field with the given value to the serialized form.

The fields type is int[].

Java int[] is mapped to .NET System.Int32[].

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written

◆ WriteLong()

IPdxInstanceFactory ^ Apache::Geode::Client::IPdxInstanceFactory::WriteLong ( String^  fieldName,
Int64  value 
)

Writes the named field with the given value to the serialized form.

The fields type is long.

Java long is mapped to .NET System.Int64.

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written


◆ WriteLongArray()

IPdxInstanceFactory ^ Apache::Geode::Client::IPdxInstanceFactory::WriteLongArray ( String^  fieldName,
array< Int64 >^  value 
)

Writes the named field with the given value to the serialized form.

The fields type is long[].

Java long[] is mapped to .NET System.Int64[].

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written

◆ WriteObject()

IPdxInstanceFactory ^ Apache::Geode::Client::IPdxInstanceFactory::WriteObject ( String^  fieldName,
Object^  value 
)

Writes the named field with the given value to the serialized form.

The fields type is Object.

It is best to use one of the other writeXXX methods if your field type will always be XXX. This method allows the field value to be anything that is an instance of Object. This gives you more flexibility but more space is used to store the serialized field.

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written

◆ WriteObjectArray()

IPdxInstanceFactory ^ Apache::Geode::Client::IPdxInstanceFactory::WriteObjectArray ( String^  fieldName,
System::Collections::Generic::List< Object^>^  value 
)

Writes the named field with the given value to the serialized form.

The fields type is Object[]. Java Object[] is mapped to .NET System.Collections.Generic.List<Object>.

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written

◆ WriteShort()

IPdxInstanceFactory ^ Apache::Geode::Client::IPdxInstanceFactory::WriteShort ( String^  fieldName,
Int16  value 
)

Writes the named field with the given value to the serialized form.

The fields type is short.

Java short is mapped to .NET System.Int16.

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written

◆ WriteShortArray()

IPdxInstanceFactory ^ Apache::Geode::Client::IPdxInstanceFactory::WriteShortArray ( String^  fieldName,
array< Int16 >^  value 
)

Writes the named field with the given value to the serialized form.

The fields type is short[].

Java short[] is mapped to .NET System.Int16[].

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written

◆ WriteString()

IPdxInstanceFactory ^ Apache::Geode::Client::IPdxInstanceFactory::WriteString ( String^  fieldName,
String^  value 
)

Writes the named field with the given value to the serialized form.

The fields type is String.

Java String is mapped to .NET System.String.

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written

◆ WriteStringArray()

IPdxInstanceFactory ^ Apache::Geode::Client::IPdxInstanceFactory::WriteStringArray ( String^  fieldName,
array< String^>^  value 
)

Writes the named field with the given value to the serialized form.

The fields type is String[].

Java String[] is mapped to .NET System.String[].

Parameters
fieldNamethe name of the field to write
valuethe value of the field to write
Returns
this PdxInstanceFactory
Exceptions
IllegalStateExceptionif the named field has already been written

Apache Geode C++ Cache .NET API Documentation