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

com.dyuproject.protostuff.ds.prk.p4.P444D Maven / Gradle / Ivy

The newest version!
// Generated by fbsgen from p/ds/prk/p4/P444.proto

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

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 P444D {
 *   required uint32 p0 = 1;
 *   required uint32 p1 = 2;
 *   required uint32 p2 = 3;
 *   required com.dyuproject.protostuff.ds.PD l = 4;
 * }
 * 
*/ public final class P444D implements Message { public static final int FN_P0 = 1; public static final int FN_P1 = 2; public static final int FN_P2 = 3; public static final int FN_L = 4; 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 P1_MIN_ERR_MESSAGE = "P1 is invalid."; static final String P2_REQUIRED_ERR_MESSAGE = "P2 is required."; static final String P2_MIN_ERR_MESSAGE = "P2 is invalid."; static final String L_REQUIRED_ERR_MESSAGE = "L is required."; /** Required. */ public Integer p0; /** Required. */ public Integer p1; /** Required. */ public Integer p2; /** Required. */ public com.dyuproject.protostuff.ds.PD l; public P444D() {} public P444D( Integer p0, Integer p1, Integer p2, com.dyuproject.protostuff.ds.PD l ) { this.p0 = p0; this.p1 = p1; this.p2 = p2; this.l = l; } public Schema cachedSchema() { return SCHEMA; } static final Schema SCHEMA = new Schema() { // schema methods public P444D newMessage() { return new P444D(); } public Class typeClass() { return P444D.class; } public String messageName() { return P444D.class.getSimpleName(); } public String messageFullName() { return P444D.class.getName(); } public boolean isInitialized(final P444D 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); } if (com.dyuproject.protostuff.RpcValidation.verifyNotNull( P1_REQUIRED_ERR_MESSAGE, message.p1)) { com.dyuproject.protostuff.RpcValidation.verifyMin(P1_MIN_ERR_MESSAGE, message.p1, 0); } if (com.dyuproject.protostuff.RpcValidation.verifyNotNull( P2_REQUIRED_ERR_MESSAGE, message.p2)) { com.dyuproject.protostuff.RpcValidation.verifyMin(P2_MIN_ERR_MESSAGE, message.p2, 0); } com.dyuproject.protostuff.RpcValidation.verifyNotNull( L_REQUIRED_ERR_MESSAGE, message.l); return true; } public void mergeFrom(final Input input, final P444D message) throws IOException { for (int number = input.readFieldNumber(this);; number = input.readFieldNumber(this)) { switch (number) { case 0: return; case 1: message.p0 = input.readUInt32(); break; case 2: message.p1 = input.readUInt32(); break; case 3: message.p2 = input.readUInt32(); break; case 4: message.l = input.mergeObject(message.l, com.dyuproject.protostuff.ds.PD.getSchema()); break; default: input.handleUnknownField(number, this); } } } public void writeTo(final Output output, final P444D message) throws IOException { if (message.p0 == null) throw new UninitializedMessageException("p0", message); output.writeUInt32(1, message.p0, false); if (message.p1 == null) throw new UninitializedMessageException("p1", message); output.writeUInt32(2, message.p1, false); if (message.p2 == null) throw new UninitializedMessageException("p2", message); output.writeUInt32(3, message.p2, false); if (message.l == null) throw new UninitializedMessageException("l", message); output.writeObject(4, message.l, com.dyuproject.protostuff.ds.PD.getSchema(), false); } public String getFieldName(final int number) { switch(number) { case 1: return "p0"; case 2: return "p1"; case 3: return "p2"; case 4: 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("p2", 3); fieldMap.put("l", 4); } }; /** * 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.writeUInt32(number, input.readUInt32(), false); break; case 2: output.writeUInt32(number, input.readUInt32(), false); break; case 3: output.writeUInt32(number, input.readUInt32(), false); break; case 4: output.writeObject(number, pipe, com.dyuproject.protostuff.ds.PD.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