com.ursaj.hfs.message.HfsUploadStatus 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;
import com.dyuproject.protostuff.UninitializedMessageException;
public final class HfsUploadStatus implements Externalizable, Message
{
public static Schema getSchema()
{
return SCHEMA;
}
public static HfsUploadStatus getDefaultInstance()
{
return DEFAULT_INSTANCE;
}
static final HfsUploadStatus DEFAULT_INSTANCE = new HfsUploadStatus();
// non-private fields
// see http://developer.android.com/guide/practices/design/performance.html#package_inner
Integer code;
String message;
public HfsUploadStatus()
{
}
public HfsUploadStatus(
Integer code,
String message
)
{
this.code = code;
this.message = message;
}
// getters and setters
// code
public Integer getCode()
{
return code;
}
public HfsUploadStatus setCode(Integer code)
{
this.code = code;
return this;
}
// message
public String getMessage()
{
return message;
}
public HfsUploadStatus setMessage(String message)
{
this.message = message;
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 HfsUploadStatus newMessage()
{
return new HfsUploadStatus();
}
public Class typeClass()
{
return HfsUploadStatus.class;
}
public String messageName()
{
return HfsUploadStatus.class.getSimpleName();
}
public String messageFullName()
{
return HfsUploadStatus.class.getName();
}
public boolean isInitialized(HfsUploadStatus message)
{
return
message.code != null
&& message.message != null;
}
public void mergeFrom(Input input, HfsUploadStatus message) throws IOException
{
for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
{
switch(number)
{
case 0:
return;
case 1:
message.code = input.readInt32();
break;
case 2:
message.message = input.readString();
break;
default:
input.handleUnknownField(number, this);
}
}
}
public void writeTo(Output output, HfsUploadStatus message) throws IOException
{
if(message.code == null)
throw new UninitializedMessageException(message);
output.writeInt32(1, message.code, false);
if(message.message == null)
throw new UninitializedMessageException(message);
output.writeString(2, message.message, false);
}
public String getFieldName(int number)
{
switch(number)
{
case 1: return "code";
case 2: return "message";
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("code", 1);
fieldMap.put("message", 2);
}
};
}