public interface PdxWriter
toData
or
PdxSerializer toData
by GemFire when it is
serializing the domain class. The domain class needs to serialize instance fields using this
interface. This interface is implemented by GemFire.
The order in which the fields are written must match the order in which they are read by
PdxReader
.
Field names are case sensitive.
All methods on this interface return itself to allow method calls to be chained together.
Modifier and Type | Method and Description |
---|---|
PdxWriter |
markIdentityField(java.lang.String fieldName)
Indicate that the named field should be included in hashCode and equals checks of this object
on a server that is accessing
PdxInstance or when a client executes a query on a
server. |
PdxWriter |
writeArrayOfByteArrays(java.lang.String fieldName,
byte[][] value)
Writes the named field with the given value to the serialized form.
|
PdxWriter |
writeBoolean(java.lang.String fieldName,
boolean value)
Writes the named field with the given value to the serialized form.
|
PdxWriter |
writeBooleanArray(java.lang.String fieldName,
boolean[] value)
Writes the named field with the given value to the serialized form.
|
PdxWriter |
writeByte(java.lang.String fieldName,
byte value)
Writes the named field with the given value to the serialized form.
|
PdxWriter |
writeByteArray(java.lang.String fieldName,
byte[] value)
Writes the named field with the given value to the serialized form.
|
PdxWriter |
writeChar(java.lang.String fieldName,
char value)
Writes the named field with the given value to the serialized form.
|
PdxWriter |
writeCharArray(java.lang.String fieldName,
char[] value)
Writes the named field with the given value to the serialized form.
|
PdxWriter |
writeDate(java.lang.String fieldName,
java.util.Date value)
Writes the named field with the given value to the serialized form.
|
PdxWriter |
writeDouble(java.lang.String fieldName,
double value)
Writes the named field with the given value to the serialized form.
|
PdxWriter |
writeDoubleArray(java.lang.String fieldName,
double[] value)
Writes the named field with the given value to the serialized form.
|
<CT,VT extends CT> |
writeField(java.lang.String fieldName,
VT fieldValue,
java.lang.Class<CT> fieldType)
Writes the named field with the given value and type to the serialized form.
|
<CT,VT extends CT> |
writeField(java.lang.String fieldName,
VT fieldValue,
java.lang.Class<CT> fieldType,
boolean checkPortability)
Writes the named field with the given value and type to the serialized form.
|
PdxWriter |
writeFloat(java.lang.String fieldName,
float value)
Writes the named field with the given value to the serialized form.
|
PdxWriter |
writeFloatArray(java.lang.String fieldName,
float[] value)
Writes the named field with the given value to the serialized form.
|
PdxWriter |
writeInt(java.lang.String fieldName,
int value)
Writes the named field with the given value to the serialized form.
|
PdxWriter |
writeIntArray(java.lang.String fieldName,
int[] value)
Writes the named field with the given value to the serialized form.
|
PdxWriter |
writeLong(java.lang.String fieldName,
long value)
Writes the named field with the given value to the serialized form.
|
PdxWriter |
writeLongArray(java.lang.String fieldName,
long[] value)
Writes the named field with the given value to the serialized form.
|
PdxWriter |
writeObject(java.lang.String fieldName,
java.lang.Object value)
Writes the named field with the given value to the serialized form.
|
PdxWriter |
writeObject(java.lang.String fieldName,
java.lang.Object value,
boolean checkPortability)
Writes the named field with the given value to the serialized form.
|
PdxWriter |
writeObjectArray(java.lang.String fieldName,
java.lang.Object[] value)
Writes the named field with the given value to the serialized form.
|
PdxWriter |
writeObjectArray(java.lang.String fieldName,
java.lang.Object[] value,
boolean checkPortability)
Writes the named field with the given value to the serialized form.
|
PdxWriter |
writeShort(java.lang.String fieldName,
short value)
Writes the named field with the given value to the serialized form.
|
PdxWriter |
writeShortArray(java.lang.String fieldName,
short[] value)
Writes the named field with the given value to the serialized form.
|
PdxWriter |
writeString(java.lang.String fieldName,
java.lang.String value)
Writes the named field with the given value to the serialized form.
|
PdxWriter |
writeStringArray(java.lang.String fieldName,
java.lang.String[] value)
Writes the named field with the given value to the serialized form.
|
PdxWriter |
writeUnreadFields(PdxUnreadFields unread)
Writes the given unread fields to the serialized form.
|
PdxWriter writeChar(java.lang.String fieldName, char value)
char
.
Java char is mapped to .NET System.Char.
fieldName
- the name of the field to writevalue
- the value of the field to writePdxFieldAlreadyExistsException
- if the named field has already been writtenPdxSerializationException
- if serialization of the field fails.PdxWriter writeBoolean(java.lang.String fieldName, boolean value)
boolean
.
Java boolean is mapped to .NET System.Boolean.
fieldName
- the name of the field to writevalue
- the value of the field to writePdxFieldAlreadyExistsException
- if the named field has already been writtenPdxSerializationException
- if serialization of the field fails.PdxWriter writeByte(java.lang.String fieldName, byte value)
byte
.
Java byte is mapped to .NET System.SByte.
fieldName
- the name of the field to writevalue
- the value of the field to writePdxFieldAlreadyExistsException
- if the named field has already been writtenPdxSerializationException
- if serialization of the field fails.PdxWriter writeShort(java.lang.String fieldName, short value)
short
.
Java short is mapped to .NET System.Int16.
fieldName
- the name of the field to writevalue
- the value of the field to writePdxFieldAlreadyExistsException
- if the named field has already been writtenPdxSerializationException
- if serialization of the field fails.PdxWriter writeInt(java.lang.String fieldName, int value)
int
.
Java int is mapped to .NET System.Int32.
fieldName
- the name of the field to writevalue
- the value of the field to writePdxFieldAlreadyExistsException
- if the named field has already been writtenPdxSerializationException
- if serialization of the field fails.PdxWriter writeLong(java.lang.String fieldName, long value)
long
.
Java long is mapped to .NET System.Int64.
fieldName
- the name of the field to writevalue
- the value of the field to writePdxFieldAlreadyExistsException
- if the named field has already been writtenPdxSerializationException
- if serialization of the field fails.PdxWriter writeFloat(java.lang.String fieldName, float value)
float
.
Java float is mapped to .NET System.Float.
fieldName
- the name of the field to writevalue
- the value of the field to writePdxFieldAlreadyExistsException
- if the named field has already been writtenPdxSerializationException
- if serialization of the field fails.PdxWriter writeDouble(java.lang.String fieldName, double value)
double
.
Java double is mapped to .NET System.Double.
fieldName
- the name of the field to writevalue
- the value of the field to writePdxFieldAlreadyExistsException
- if the named field has already been writtenPdxSerializationException
- if serialization of the field fails.PdxWriter writeDate(java.lang.String fieldName, java.util.Date value)
Date
.
Java Date is mapped to .NET System.DateTime.
fieldName
- the name of the field to writevalue
- the value of the field to writePdxFieldAlreadyExistsException
- if the named field has already been writtenPdxSerializationException
- if serialization of the field fails.PdxWriter writeString(java.lang.String fieldName, java.lang.String value)
String
.
Java String is mapped to .NET System.String.
fieldName
- the name of the field to writevalue
- the value of the field to writePdxFieldAlreadyExistsException
- if the named field has already been writtenPdxSerializationException
- if serialization of the field fails.PdxWriter writeObject(java.lang.String fieldName, java.lang.Object value)
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.
Note that some Java objects serialized with this method may not be compatible with non-java
languages. To ensure that only portable objects are serialized use
writeObject(String, Object, boolean)
.
fieldName
- the name of the field to writevalue
- the value of the field to writePdxFieldAlreadyExistsException
- if the named field has already been writtenPdxSerializationException
- if serialization of the field fails.PdxWriter writeObject(java.lang.String fieldName, java.lang.Object value, boolean checkPortability)
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.
Note that some Java objects serialized with this method may not be compatible with non-java
languages. To ensure that only portable objects are serialized set the
checkPortability
parameter to true. The following is a list of the Java classes
that are portable and the .NET class they are mapped to:
PdxSerializable
: .NET class of same name
PdxInstance
: .NET class of same name
PdxSerializer
: .NET class of same name