com.ursaj.hfs.message.HfsMessage Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hfs-messages Show documentation
Show all versions of hfs-messages Show documentation
HFS communication messages.
// Generated by http://code.google.com/p/protostuff/ ... DO NOT EDIT!
// Generated from messages.proto
package com.ursaj.hfs.message;
import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import com.dyuproject.protostuff.GraphIOUtil;
import com.dyuproject.protostuff.Input;
import com.dyuproject.protostuff.Message;
import com.dyuproject.protostuff.Output;
import com.dyuproject.protostuff.Schema;
public final class HfsMessage implements Externalizable, Message
{
public static Schema getSchema()
{
return SCHEMA;
}
public static HfsMessage getDefaultInstance()
{
return DEFAULT_INSTANCE;
}
static final HfsMessage DEFAULT_INSTANCE = new HfsMessage();
// non-private fields
// see http://developer.android.com/guide/practices/design/performance.html#package_inner
HfsGcRequest gcRequest;
HfsGetRequest getRequest;
HfsUploadRequest uploadRequest;
HfsUploadInfo uploadInfo;
public HfsMessage()
{
}
// getters and setters
// gcRequest
public HfsGcRequest getGcRequest()
{
return gcRequest;
}
public HfsMessage setGcRequest(HfsGcRequest gcRequest)
{
this.gcRequest = gcRequest;
return this;
}
// getRequest
public HfsGetRequest getGetRequest()
{
return getRequest;
}
public HfsMessage setGetRequest(HfsGetRequest getRequest)
{
this.getRequest = getRequest;
return this;
}
// uploadRequest
public HfsUploadRequest getUploadRequest()
{
return uploadRequest;
}
public HfsMessage setUploadRequest(HfsUploadRequest uploadRequest)
{
this.uploadRequest = uploadRequest;
return this;
}
// uploadInfo
public HfsUploadInfo getUploadInfo()
{
return uploadInfo;
}
public HfsMessage setUploadInfo(HfsUploadInfo uploadInfo)
{
this.uploadInfo = uploadInfo;
return this;
}
// java serialization
public void readExternal(ObjectInput in) throws IOException
{
GraphIOUtil.mergeDelimitedFrom(in, this, SCHEMA);
}
public void writeExternal(ObjectOutput out) throws IOException
{
GraphIOUtil.writeDelimitedTo(out, this, SCHEMA);
}
// message method
public Schema cachedSchema()
{
return SCHEMA;
}
static final Schema SCHEMA = new Schema()
{
// schema methods
public HfsMessage newMessage()
{
return new HfsMessage();
}
public Class typeClass()
{
return HfsMessage.class;
}
public String messageName()
{
return HfsMessage.class.getSimpleName();
}
public String messageFullName()
{
return HfsMessage.class.getName();
}
public boolean isInitialized(HfsMessage message)
{
return true;
}
public void mergeFrom(Input input, HfsMessage message) throws IOException
{
for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
{
switch(number)
{
case 0:
return;
case 1:
message.gcRequest = input.mergeObject(message.gcRequest, HfsGcRequest.getSchema());
break;
case 2:
message.getRequest = input.mergeObject(message.getRequest, HfsGetRequest.getSchema());
break;
case 3:
message.uploadRequest = input.mergeObject(message.uploadRequest, HfsUploadRequest.getSchema());
break;
case 5:
message.uploadInfo = input.mergeObject(message.uploadInfo, HfsUploadInfo.getSchema());
break;
default:
input.handleUnknownField(number, this);
}
}
}
public void writeTo(Output output, HfsMessage message) throws IOException
{
if(message.gcRequest != null)
output.writeObject(1, message.gcRequest, HfsGcRequest.getSchema(), false);
if(message.getRequest != null)
output.writeObject(2, message.getRequest, HfsGetRequest.getSchema(), false);
if(message.uploadRequest != null)
output.writeObject(3, message.uploadRequest, HfsUploadRequest.getSchema(), false);
if(message.uploadInfo != null)
output.writeObject(5, message.uploadInfo, HfsUploadInfo.getSchema(), false);
}
public String getFieldName(int number)
{
switch(number)
{
case 1: return "gcRequest";
case 2: return "getRequest";
case 3: return "uploadRequest";
case 5: return "uploadInfo";
default: return null;
}
}
public int getFieldNumber(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("gcRequest", 1);
fieldMap.put("getRequest", 2);
fieldMap.put("uploadRequest", 3);
fieldMap.put("uploadInfo", 5);
}
};
}