All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.dyuproject.protostuff.ds.prk.p1.P1S8 Maven / Gradle / Ivy

The newest version!
// Generated by fbsgen from p/ds/prk/p1/P1S.proto

package com.dyuproject.protostuff.ds.prk.p1;

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 P1S8 {
 *   required int8 p0 = 1;
 *   required string p1 = 2;
 *   required com.dyuproject.protostuff.ds.P8 l = 3;
 * }
 * 
*/ public final class P1S8 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_RANGE_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 Integer p0; /** Required. */ public String p1; /** Required. */ public com.dyuproject.protostuff.ds.P8 l; public P1S8() {} public P1S8( Integer p0, String p1, com.dyuproject.protostuff.ds.P8 l ) { this.p0 = p0; this.p1 = p1; this.l = l; } public Schema cachedSchema() { return SCHEMA; } static final Schema SCHEMA = new Schema() { // schema methods public P1S8 newMessage() { return new P1S8(); } public Class typeClass() { return P1S8.class; } public String messageName() { return P1S8.class.getSimpleName(); } public String messageFullName() { return P1S8.class.getName(); } public boolean isInitialized(final P1S8 message) { if (com.dyuproject.protostuff.RpcValidation.verifyNotNull( P0_REQUIRED_ERR_MESSAGE, message.p0)) { com.dyuproject.protostuff.RpcValidation.verifyRange(P0_RANGE_ERR_MESSAGE, message.p0, 0, 127); } 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 P1S8 message) throws IOException { for (int number = input.readFieldNumber(this);; number = input.readFieldNumber(this)) { switch (number) { case 0: return; case 1: message.p0 = input.readInt32(); break; case 2: message.p1 = input.readString(); break; case 3: message.l = input.mergeObject(message.l, com.dyuproject.protostuff.ds.P8.getSchema()); break; default: input.handleUnknownField(number, this); } } } public void writeTo(final Output output, final P1S8 message) throws IOException { if (message.p0 == null) throw new UninitializedMessageException("p0", message); output.writeInt32(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.P8.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.writeInt32(number, input.readInt32(), false); break; case 2: input.transferByteRangeTo(output, true, number, false); break; case 3: output.writeObject(number, pipe, com.dyuproject.protostuff.ds.P8.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