Package io.protostuff
Class Pipe.Schema<T>
- java.lang.Object
-
- io.protostuff.Pipe.Schema<T>
-
-
Field Summary
Fields Modifier and Type Field Description Schema<T>wrappedSchema
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetFieldName(int number)Gets the field name associated with the number.intgetFieldNumber(java.lang.String name)Gets the field number associated with the name.booleanisInitialized(Pipe message)Always returns true since we're just transferring data.voidmergeFrom(Input input, Pipe pipe)Deserializes a message/object from theinput.java.lang.StringmessageFullName()Returns the full name of the message tied to this schema.java.lang.StringmessageName()Returns the simple name of the message tied to this schema.PipenewMessage()Creates the message/object tied to this schema.protected abstract voidtransfer(Pipe pipe, Input input, Output output)java.lang.Class<Pipe>typeClass()Gets the class of the message.voidwriteTo(Output output, Pipe pipe)Serializes a message/object to theoutput.
-
-
-
Method Detail
-
getFieldName
public java.lang.String getFieldName(int number)
Description copied from interface:SchemaGets the field name associated with the number. This is particularly useful when serializing to different formats (Eg. JSON). When using numeric field names:return String.valueOf(number);
- Specified by:
getFieldNamein interfaceSchema<T>
-
getFieldNumber
public int getFieldNumber(java.lang.String name)
Description copied from interface:SchemaGets the field number associated with the name. This is particularly useful when serializing to different formats (Eg. JSON). When using numeric field names:return Integer.parseInt(name);
- Specified by:
getFieldNumberin interfaceSchema<T>
-
isInitialized
public boolean isInitialized(Pipe message)
Always returns true since we're just transferring data.- Specified by:
isInitializedin interfaceSchema<T>
-
messageFullName
public java.lang.String messageFullName()
Description copied from interface:SchemaReturns the full name of the message tied to this schema. Allows custom schemas to provide a custom name other than typeClass().getName();- Specified by:
messageFullNamein interfaceSchema<T>
-
messageName
public java.lang.String messageName()
Description copied from interface:SchemaReturns the simple name of the message tied to this schema. Allows custom schemas to provide a custom name other than typeClass().getSimpleName();- Specified by:
messageNamein interfaceSchema<T>
-
newMessage
public Pipe newMessage()
Description copied from interface:SchemaCreates the message/object tied to this schema.- Specified by:
newMessagein interfaceSchema<T>
-
typeClass
public java.lang.Class<Pipe> typeClass()
Description copied from interface:SchemaGets the class of the message.
-
writeTo
public final void writeTo(Output output, Pipe pipe) throws java.io.IOException
Description copied from interface:SchemaSerializes a message/object to theoutput.
-
mergeFrom
public final void mergeFrom(Input input, Pipe pipe) throws java.io.IOException
Description copied from interface:SchemaDeserializes a message/object from theinput.
-
-