|
GemFire 6.6.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface PdxSerializable
When a domain class implements PdxSerializable it marks
itself as a PDX.
The implementation of toData provides the serialization
code and fromData provides the deserialization code.
These methods also define each field name and field type
of the PDX. Domain classes should serialize and deserialize
all its member fields in the same order in toData and fromData
method. Also fromData and toData must read and write the same fields
each time they are called.
A domain class that implements this interface must also have
a public zero-arg constructor which is used during deserialization.
Simple example:
public class User implements PdxSerializable {
private String name;
private int userId;
public User() {
}
public void toData(PdxWriter out) {
out.writeString("name", this.name);
out.writeInt("userId", this.userId);
}
public void fromData(PdxReader in) {
this.name = in.readString("name");
this.userId = in.readInt("userId");
}
}
| Method Summary | |
|---|---|
void |
fromData(PdxReader reader)
Deserializes the PDX fields using the given reader. |
void |
toData(PdxWriter writer)
Serializes the PDX fields using the given writer. |
| Method Detail |
|---|
void toData(PdxWriter writer)
writer - the PdxWriter to use to write the PDX fields.void fromData(PdxReader reader)
reader - the PdxReader to use to read the PDX fields.
|
GemFire 6.6.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||