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