fixed protobuf new version issues and some minor changes in Actor and ActorRef from merging

This commit is contained in:
Debasish Ghosh 2011-06-13 17:17:53 +05:30
parent f27e23bf1d
commit 0d471ae084
5 changed files with 4675 additions and 1464 deletions

View file

@ -8,11 +8,27 @@ public final class ProtobufProtocol {
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
}
public interface MyMessageOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required uint64 id = 1;
boolean hasId();
long getId();
// required string name = 2;
boolean hasName();
String getName();
// required bool status = 3;
boolean hasStatus();
boolean getStatus();
}
public static final class MyMessage extends
com.google.protobuf.GeneratedMessage {
com.google.protobuf.GeneratedMessage
implements MyMessageOrBuilder {
// Use MyMessage.newBuilder() to construct.
private MyMessage() {
initFields();
private MyMessage(Builder builder) {
super(builder);
}
private MyMessage(boolean noInit) {}
@ -35,47 +51,96 @@ public final class ProtobufProtocol {
return akka.actor.ProtobufProtocol.internal_static_akka_actor_MyMessage_fieldAccessorTable;
}
private int bitField0_;
// required uint64 id = 1;
public static final int ID_FIELD_NUMBER = 1;
private boolean hasId;
private long id_ = 0L;
public boolean hasId() { return hasId; }
public long getId() { return id_; }
private long id_;
public boolean hasId() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
public long getId() {
return id_;
}
// required string name = 2;
public static final int NAME_FIELD_NUMBER = 2;
private boolean hasName;
private java.lang.String name_ = "";
public boolean hasName() { return hasName; }
public java.lang.String getName() { return name_; }
private java.lang.Object name_;
public boolean hasName() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
public String getName() {
java.lang.Object ref = name_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
if (com.google.protobuf.Internal.isValidUtf8(bs)) {
name_ = s;
}
return s;
}
}
private com.google.protobuf.ByteString getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// required bool status = 3;
public static final int STATUS_FIELD_NUMBER = 3;
private boolean hasStatus;
private boolean status_ = false;
public boolean hasStatus() { return hasStatus; }
public boolean getStatus() { return status_; }
private boolean status_;
public boolean hasStatus() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
public boolean getStatus() {
return status_;
}
private void initFields() {
id_ = 0L;
name_ = "";
status_ = false;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
if (!hasId) return false;
if (!hasName) return false;
if (!hasStatus) return false;
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (!hasId()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasName()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasStatus()) {
memoizedIsInitialized = 0;
return false;
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (hasId()) {
output.writeUInt64(1, getId());
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeUInt64(1, id_);
}
if (hasName()) {
output.writeString(2, getName());
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeBytes(2, getNameBytes());
}
if (hasStatus()) {
output.writeBool(3, getStatus());
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeBool(3, status_);
}
getUnknownFields().writeTo(output);
}
@ -86,23 +151,30 @@ public final class ProtobufProtocol {
if (size != -1) return size;
size = 0;
if (hasId()) {
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt64Size(1, getId());
.computeUInt64Size(1, id_);
}
if (hasName()) {
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeStringSize(2, getName());
.computeBytesSize(2, getNameBytes());
}
if (hasStatus()) {
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(3, getStatus());
.computeBoolSize(3, status_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static akka.actor.ProtobufProtocol.MyMessage parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
@ -177,34 +249,55 @@ public final class ProtobufProtocol {
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder> {
private akka.actor.ProtobufProtocol.MyMessage result;
// Construct using akka.actor.ProtobufProtocol.MyMessage.newBuilder()
private Builder() {}
private static Builder create() {
Builder builder = new Builder();
builder.result = new akka.actor.ProtobufProtocol.MyMessage();
return builder;
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements akka.actor.ProtobufProtocol.MyMessageOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return akka.actor.ProtobufProtocol.internal_static_akka_actor_MyMessage_descriptor;
}
protected akka.actor.ProtobufProtocol.MyMessage internalGetResult() {
return result;
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return akka.actor.ProtobufProtocol.internal_static_akka_actor_MyMessage_fieldAccessorTable;
}
// Construct using akka.actor.ProtobufProtocol.MyMessage.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
if (result == null) {
throw new IllegalStateException(
"Cannot call clear() after build().");
}
result = new akka.actor.ProtobufProtocol.MyMessage();
super.clear();
id_ = 0L;
bitField0_ = (bitField0_ & ~0x00000001);
name_ = "";
bitField0_ = (bitField0_ & ~0x00000002);
status_ = false;
bitField0_ = (bitField0_ & ~0x00000004);
return this;
}
public Builder clone() {
return create().mergeFrom(result);
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
@ -216,33 +309,43 @@ public final class ProtobufProtocol {
return akka.actor.ProtobufProtocol.MyMessage.getDefaultInstance();
}
public boolean isInitialized() {
return result.isInitialized();
}
public akka.actor.ProtobufProtocol.MyMessage build() {
if (result != null && !isInitialized()) {
akka.actor.ProtobufProtocol.MyMessage result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return buildPartial();
return result;
}
private akka.actor.ProtobufProtocol.MyMessage buildParsed()
throws com.google.protobuf.InvalidProtocolBufferException {
if (!isInitialized()) {
akka.actor.ProtobufProtocol.MyMessage result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(
result).asInvalidProtocolBufferException();
}
return buildPartial();
return result;
}
public akka.actor.ProtobufProtocol.MyMessage buildPartial() {
if (result == null) {
throw new IllegalStateException(
"build() has already been called on this Builder.");
akka.actor.ProtobufProtocol.MyMessage result = new akka.actor.ProtobufProtocol.MyMessage(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
akka.actor.ProtobufProtocol.MyMessage returnMe = result;
result = null;
return returnMe;
result.id_ = id_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.name_ = name_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.status_ = status_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
@ -269,6 +372,22 @@ public final class ProtobufProtocol {
return this;
}
public final boolean isInitialized() {
if (!hasId()) {
return false;
}
if (!hasName()) {
return false;
}
if (!hasStatus()) {
return false;
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
@ -281,86 +400,113 @@ public final class ProtobufProtocol {
switch (tag) {
case 0:
this.setUnknownFields(unknownFields.build());
onChanged();
return this;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
this.setUnknownFields(unknownFields.build());
onChanged();
return this;
}
break;
}
case 8: {
setId(input.readUInt64());
bitField0_ |= 0x00000001;
id_ = input.readUInt64();
break;
}
case 18: {
setName(input.readString());
bitField0_ |= 0x00000002;
name_ = input.readBytes();
break;
}
case 24: {
setStatus(input.readBool());
bitField0_ |= 0x00000004;
status_ = input.readBool();
break;
}
}
}
}
private int bitField0_;
// required uint64 id = 1;
private long id_ ;
public boolean hasId() {
return result.hasId();
return ((bitField0_ & 0x00000001) == 0x00000001);
}
public long getId() {
return result.getId();
return id_;
}
public Builder setId(long value) {
result.hasId = true;
result.id_ = value;
bitField0_ |= 0x00000001;
id_ = value;
onChanged();
return this;
}
public Builder clearId() {
result.hasId = false;
result.id_ = 0L;
bitField0_ = (bitField0_ & ~0x00000001);
id_ = 0L;
onChanged();
return this;
}
// required string name = 2;
private java.lang.Object name_ = "";
public boolean hasName() {
return result.hasName();
return ((bitField0_ & 0x00000002) == 0x00000002);
}
public java.lang.String getName() {
return result.getName();
public String getName() {
java.lang.Object ref = name_;
if (!(ref instanceof String)) {
String s = ((com.google.protobuf.ByteString) ref).toStringUtf8();
name_ = s;
return s;
} else {
return (String) ref;
}
}
public Builder setName(java.lang.String value) {
public Builder setName(String value) {
if (value == null) {
throw new NullPointerException();
}
result.hasName = true;
result.name_ = value;
bitField0_ |= 0x00000002;
name_ = value;
onChanged();
return this;
}
public Builder clearName() {
result.hasName = false;
result.name_ = getDefaultInstance().getName();
bitField0_ = (bitField0_ & ~0x00000002);
name_ = getDefaultInstance().getName();
onChanged();
return this;
}
void setName(com.google.protobuf.ByteString value) {
bitField0_ |= 0x00000002;
name_ = value;
onChanged();
}
// required bool status = 3;
private boolean status_ ;
public boolean hasStatus() {
return result.hasStatus();
return ((bitField0_ & 0x00000004) == 0x00000004);
}
public boolean getStatus() {
return result.getStatus();
return status_;
}
public Builder setStatus(boolean value) {
result.hasStatus = true;
result.status_ = value;
bitField0_ |= 0x00000004;
status_ = value;
onChanged();
return this;
}
public Builder clearStatus() {
result.hasStatus = false;
result.status_ = false;
bitField0_ = (bitField0_ & ~0x00000004);
status_ = false;
onChanged();
return this;
}
@ -369,7 +515,6 @@ public final class ProtobufProtocol {
static {
defaultInstance = new MyMessage(true);
akka.actor.ProtobufProtocol.internalForceInit();
defaultInstance.initFields();
}
@ -416,7 +561,5 @@ public final class ProtobufProtocol {
}, assigner);
}
public static void internalForceInit() {}
// @@protoc_insertion_point(outer_class_scope)
}