|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Schema<T>
Handles the serialization and deserialization of a message/object tied to this.
Basically, any object can be serialized via protobuf.
As long as its schema is provided, it does not need to implement Message.
This was designed with "unobtrusive" in mind.
The goal was to be able to serialize/deserialize any existing object without
having to touch its source.
This will enable you to customize the serialization of objects from
3rd party libraries.
| Method Summary | |
|---|---|
java.lang.String |
getFieldName(int number)
Gets the field name associated with the number. |
int |
getFieldNumber(java.lang.String name)
Gets the field number associated with the name. |
boolean |
isInitialized(T message)
Returns true if there is no required field or if all the required fields are set. |
void |
mergeFrom(Input input,
T message)
Deserializes a message/object from the input. |
java.lang.String |
messageFullName()
Returns the full name of the message tied to this schema. |
java.lang.String |
messageName()
Returns the simple name of the message tied to this schema. |
T |
newMessage()
Creates the message/object tied to this schema. |
java.lang.Class<? super T> |
typeClass()
Gets the class of the message. |
void |
writeTo(Output output,
T message)
Serializes a message/object to the output. |
| Method Detail |
|---|
java.lang.String getFieldName(int number)
return String.valueOf(number);
int getFieldNumber(java.lang.String name)
return Integer.parseInt(name);
boolean isInitialized(T message)
T newMessage()
java.lang.String messageName()
java.lang.String messageFullName()
java.lang.Class<? super T> typeClass()
void mergeFrom(Input input,
T message)
throws java.io.IOException
input.
java.io.IOException
void writeTo(Output output,
T message)
throws java.io.IOException
output.
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||