
com.dyuproject.protostuff.ds.prk.p8.P8S4 Maven / Gradle / Ivy
The newest version!
// Generated by fbsgen from p/ds/prk/p8/P8S.proto
package com.dyuproject.protostuff.ds.prk.p8;
import java.io.IOException;
import com.dyuproject.protostuff.Input;
import com.dyuproject.protostuff.Message;
import com.dyuproject.protostuff.Output;
import com.dyuproject.protostuff.Pipe;
import com.dyuproject.protostuff.Schema;
import com.dyuproject.protostuff.UninitializedMessageException;
/**
*
* message P8S4 {
* required uint64 p0 = 1;
* required string p1 = 2;
* required com.dyuproject.protostuff.ds.P4 l = 3;
* }
*
*/
public final class P8S4 implements Message
{
public static final int FN_P0 = 1;
public static final int FN_P1 = 2;
public static final int FN_L = 3;
static final String P0_REQUIRED_ERR_MESSAGE = "P0 is required.";
static final String P0_MIN_ERR_MESSAGE = "P0 is invalid.";
static final String P1_REQUIRED_ERR_MESSAGE = "P1 is required.";
static final String L_REQUIRED_ERR_MESSAGE = "L is required.";
/** Required. */
public Long p0;
/** Required. */
public String p1;
/** Required. */
public com.dyuproject.protostuff.ds.P4 l;
public P8S4() {}
public P8S4(
Long p0,
String p1,
com.dyuproject.protostuff.ds.P4 l
)
{
this.p0 = p0;
this.p1 = p1;
this.l = l;
}
public Schema cachedSchema() { return SCHEMA; }
static final Schema SCHEMA = new Schema()
{
// schema methods
public P8S4 newMessage()
{
return new P8S4();
}
public Class typeClass()
{
return P8S4.class;
}
public String messageName()
{
return P8S4.class.getSimpleName();
}
public String messageFullName()
{
return P8S4.class.getName();
}
public boolean isInitialized(final P8S4 message)
{
if (com.dyuproject.protostuff.RpcValidation.verifyNotNull(
P0_REQUIRED_ERR_MESSAGE, message.p0))
{
com.dyuproject.protostuff.RpcValidation.verifyMin(P0_MIN_ERR_MESSAGE, message.p0, 0);
}
com.dyuproject.protostuff.RpcValidation.verifyNotNull(
P1_REQUIRED_ERR_MESSAGE, message.p1);
com.dyuproject.protostuff.RpcValidation.verifyNotNull(
L_REQUIRED_ERR_MESSAGE, message.l);
return true;
}
public void mergeFrom(final Input input, final P8S4 message) throws IOException
{
for (int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
{
switch (number)
{
case 0:
return;
case 1:
message.p0 = input.readFixed64();
break;
case 2:
message.p1 = input.readString();
break;
case 3:
message.l = input.mergeObject(message.l, com.dyuproject.protostuff.ds.P4.getSchema());
break;
default:
input.handleUnknownField(number, this);
}
}
}
public void writeTo(final Output output, final P8S4 message) throws IOException
{
if (message.p0 == null)
throw new UninitializedMessageException("p0", message);
output.writeFixed64(1, message.p0, false);
if (message.p1 == null)
throw new UninitializedMessageException("p1", message);
output.writeString(2, message.p1, false);
if (message.l == null)
throw new UninitializedMessageException("l", message);
output.writeObject(3, message.l, com.dyuproject.protostuff.ds.P4.getSchema(), false);
}
public String getFieldName(final int number)
{
switch(number)
{
case 1: return "p0";
case 2: return "p1";
case 3: return "l";
default: return null;
}
}
public int getFieldNumber(final String name)
{
final Integer number = fieldMap.get(name);
return number == null ? 0 : number.intValue();
}
final java.util.HashMap fieldMap = new java.util.HashMap();
{
fieldMap.put("p0", 1);
fieldMap.put("p1", 2);
fieldMap.put("l", 3);
}
};
/**
* Useful for filtering (called by your custom pipe schema).
*/
public static void transferField(int number, Pipe pipe, Input input, Output output,
Schema wrappedSchema) throws IOException
{
switch (number)
{
case 1:
output.writeFixed64(number, input.readFixed64(), false);
break;
case 2:
input.transferByteRangeTo(output, true, number, false);
break;
case 3:
output.writeObject(number, pipe, com.dyuproject.protostuff.ds.P4.getPipeSchema(), false);
break;
default:
input.handleUnknownField(number, wrappedSchema);
}
}
static final Pipe.Schema PIPE_SCHEMA = new Pipe.Schema(SCHEMA)
{
protected void transfer(final Pipe pipe, final Input input, final Output output) throws IOException
{
for (int number = input.readFieldNumber(wrappedSchema);
number != 0;
number = input.readFieldNumber(wrappedSchema))
{
transferField(number, pipe, input, output, wrappedSchema);
}
}
};
public static Schema getSchema() { return SCHEMA; }
public static Pipe.Schema getPipeSchema() { return PIPE_SCHEMA; }
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy