diff options
Diffstat (limited to 'src/main/java/com/orbekk/protobuf/Data.java')
-rw-r--r-- | src/main/java/com/orbekk/protobuf/Data.java | 867 |
1 files changed, 620 insertions, 247 deletions
diff --git a/src/main/java/com/orbekk/protobuf/Data.java b/src/main/java/com/orbekk/protobuf/Data.java index c958236..32b1d15 100644 --- a/src/main/java/com/orbekk/protobuf/Data.java +++ b/src/main/java/com/orbekk/protobuf/Data.java @@ -8,11 +8,31 @@ public final class Data { public static void registerAllExtensions( com.google.protobuf.ExtensionRegistry registry) { } + public interface RequestOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // optional string full_service_name = 1; + boolean hasFullServiceName(); + String getFullServiceName(); + + // optional string method_name = 2; + boolean hasMethodName(); + String getMethodName(); + + // optional bytes request_proto = 3; + boolean hasRequestProto(); + com.google.protobuf.ByteString getRequestProto(); + + // optional int64 request_id = 4; + boolean hasRequestId(); + long getRequestId(); + } public static final class Request extends - com.google.protobuf.GeneratedMessage { + com.google.protobuf.GeneratedMessage + implements RequestOrBuilder { // Use Request.newBuilder() to construct. - private Request() { - initFields(); + private Request(Builder builder) { + super(builder); } private Request(boolean noInit) {} @@ -35,54 +55,120 @@ public final class Data { return com.orbekk.protobuf.Data.internal_static_com_orbekk_protobuf_Request_fieldAccessorTable; } + private int bitField0_; // optional string full_service_name = 1; public static final int FULL_SERVICE_NAME_FIELD_NUMBER = 1; - private boolean hasFullServiceName; - private java.lang.String fullServiceName_ = ""; - public boolean hasFullServiceName() { return hasFullServiceName; } - public java.lang.String getFullServiceName() { return fullServiceName_; } + private java.lang.Object fullServiceName_; + public boolean hasFullServiceName() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + public String getFullServiceName() { + java.lang.Object ref = fullServiceName_; + 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)) { + fullServiceName_ = s; + } + return s; + } + } + private com.google.protobuf.ByteString getFullServiceNameBytes() { + java.lang.Object ref = fullServiceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((String) ref); + fullServiceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } // optional string method_name = 2; public static final int METHOD_NAME_FIELD_NUMBER = 2; - private boolean hasMethodName; - private java.lang.String methodName_ = ""; - public boolean hasMethodName() { return hasMethodName; } - public java.lang.String getMethodName() { return methodName_; } + private java.lang.Object methodName_; + public boolean hasMethodName() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + public String getMethodName() { + java.lang.Object ref = methodName_; + 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)) { + methodName_ = s; + } + return s; + } + } + private com.google.protobuf.ByteString getMethodNameBytes() { + java.lang.Object ref = methodName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((String) ref); + methodName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } // optional bytes request_proto = 3; public static final int REQUEST_PROTO_FIELD_NUMBER = 3; - private boolean hasRequestProto; - private com.google.protobuf.ByteString requestProto_ = com.google.protobuf.ByteString.EMPTY; - public boolean hasRequestProto() { return hasRequestProto; } - public com.google.protobuf.ByteString getRequestProto() { return requestProto_; } + private com.google.protobuf.ByteString requestProto_; + public boolean hasRequestProto() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + public com.google.protobuf.ByteString getRequestProto() { + return requestProto_; + } // optional int64 request_id = 4; public static final int REQUEST_ID_FIELD_NUMBER = 4; - private boolean hasRequestId; - private long requestId_ = 0L; - public boolean hasRequestId() { return hasRequestId; } - public long getRequestId() { return requestId_; } + private long requestId_; + public boolean hasRequestId() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + public long getRequestId() { + return requestId_; + } private void initFields() { + fullServiceName_ = ""; + methodName_ = ""; + requestProto_ = com.google.protobuf.ByteString.EMPTY; + requestId_ = 0L; } + private byte memoizedIsInitialized = -1; public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + memoizedIsInitialized = 1; return true; } public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - if (hasFullServiceName()) { - output.writeString(1, getFullServiceName()); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, getFullServiceNameBytes()); } - if (hasMethodName()) { - output.writeString(2, getMethodName()); + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getMethodNameBytes()); } - if (hasRequestProto()) { - output.writeBytes(3, getRequestProto()); + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(3, requestProto_); } - if (hasRequestId()) { - output.writeInt64(4, getRequestId()); + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeInt64(4, requestId_); } getUnknownFields().writeTo(output); } @@ -93,27 +179,34 @@ public final class Data { if (size != -1) return size; size = 0; - if (hasFullServiceName()) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeStringSize(1, getFullServiceName()); + .computeBytesSize(1, getFullServiceNameBytes()); } - if (hasMethodName()) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream - .computeStringSize(2, getMethodName()); + .computeBytesSize(2, getMethodNameBytes()); } - if (hasRequestProto()) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(3, getRequestProto()); + .computeBytesSize(3, requestProto_); } - if (hasRequestId()) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(4, getRequestId()); + .computeInt64Size(4, requestId_); } 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 com.orbekk.protobuf.Data.Request parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -188,34 +281,57 @@ public final class Data { } 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 com.orbekk.protobuf.Data.Request result; + com.google.protobuf.GeneratedMessage.Builder<Builder> + implements com.orbekk.protobuf.Data.RequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.orbekk.protobuf.Data.internal_static_com_orbekk_protobuf_Request_descriptor; + } - // Construct using com.orbekk.protobuf.Data.Request.newBuilder() - private Builder() {} + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.orbekk.protobuf.Data.internal_static_com_orbekk_protobuf_Request_fieldAccessorTable; + } - private static Builder create() { - Builder builder = new Builder(); - builder.result = new com.orbekk.protobuf.Data.Request(); - return builder; + // Construct using com.orbekk.protobuf.Data.Request.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); } - protected com.orbekk.protobuf.Data.Request internalGetResult() { - return result; + 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 com.orbekk.protobuf.Data.Request(); + super.clear(); + fullServiceName_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + methodName_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + requestProto_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + requestId_ = 0L; + bitField0_ = (bitField0_ & ~0x00000008); return this; } public Builder clone() { - return create().mergeFrom(result); + return create().mergeFrom(buildPartial()); } public com.google.protobuf.Descriptors.Descriptor @@ -227,33 +343,47 @@ public final class Data { return com.orbekk.protobuf.Data.Request.getDefaultInstance(); } - public boolean isInitialized() { - return result.isInitialized(); - } public com.orbekk.protobuf.Data.Request build() { - if (result != null && !isInitialized()) { + com.orbekk.protobuf.Data.Request result = buildPartial(); + if (!result.isInitialized()) { throw newUninitializedMessageException(result); } - return buildPartial(); + return result; } private com.orbekk.protobuf.Data.Request buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { - if (!isInitialized()) { + com.orbekk.protobuf.Data.Request result = buildPartial(); + if (!result.isInitialized()) { throw newUninitializedMessageException( result).asInvalidProtocolBufferException(); } - return buildPartial(); + return result; } public com.orbekk.protobuf.Data.Request buildPartial() { - if (result == null) { - throw new IllegalStateException( - "build() has already been called on this Builder."); + com.orbekk.protobuf.Data.Request result = new com.orbekk.protobuf.Data.Request(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; } - com.orbekk.protobuf.Data.Request returnMe = result; - result = null; - return returnMe; + result.fullServiceName_ = fullServiceName_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.methodName_ = methodName_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.requestProto_ = requestProto_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.requestId_ = requestId_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; } public Builder mergeFrom(com.google.protobuf.Message other) { @@ -283,6 +413,10 @@ public final class Data { return this; } + public final boolean isInitialized() { + return true; + } + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -295,114 +429,157 @@ public final class Data { 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 10: { - setFullServiceName(input.readString()); + bitField0_ |= 0x00000001; + fullServiceName_ = input.readBytes(); break; } case 18: { - setMethodName(input.readString()); + bitField0_ |= 0x00000002; + methodName_ = input.readBytes(); break; } case 26: { - setRequestProto(input.readBytes()); + bitField0_ |= 0x00000004; + requestProto_ = input.readBytes(); break; } case 32: { - setRequestId(input.readInt64()); + bitField0_ |= 0x00000008; + requestId_ = input.readInt64(); break; } } } } + private int bitField0_; // optional string full_service_name = 1; + private java.lang.Object fullServiceName_ = ""; public boolean hasFullServiceName() { - return result.hasFullServiceName(); - } - public java.lang.String getFullServiceName() { - return result.getFullServiceName(); + return ((bitField0_ & 0x00000001) == 0x00000001); + } + public String getFullServiceName() { + java.lang.Object ref = fullServiceName_; + if (!(ref instanceof String)) { + String s = ((com.google.protobuf.ByteString) ref).toStringUtf8(); + fullServiceName_ = s; + return s; + } else { + return (String) ref; + } } - public Builder setFullServiceName(java.lang.String value) { + public Builder setFullServiceName(String value) { if (value == null) { throw new NullPointerException(); } - result.hasFullServiceName = true; - result.fullServiceName_ = value; + bitField0_ |= 0x00000001; + fullServiceName_ = value; + onChanged(); return this; } public Builder clearFullServiceName() { - result.hasFullServiceName = false; - result.fullServiceName_ = getDefaultInstance().getFullServiceName(); + bitField0_ = (bitField0_ & ~0x00000001); + fullServiceName_ = getDefaultInstance().getFullServiceName(); + onChanged(); return this; } + void setFullServiceName(com.google.protobuf.ByteString value) { + bitField0_ |= 0x00000001; + fullServiceName_ = value; + onChanged(); + } // optional string method_name = 2; + private java.lang.Object methodName_ = ""; public boolean hasMethodName() { - return result.hasMethodName(); - } - public java.lang.String getMethodName() { - return result.getMethodName(); + return ((bitField0_ & 0x00000002) == 0x00000002); + } + public String getMethodName() { + java.lang.Object ref = methodName_; + if (!(ref instanceof String)) { + String s = ((com.google.protobuf.ByteString) ref).toStringUtf8(); + methodName_ = s; + return s; + } else { + return (String) ref; + } } - public Builder setMethodName(java.lang.String value) { + public Builder setMethodName(String value) { if (value == null) { throw new NullPointerException(); } - result.hasMethodName = true; - result.methodName_ = value; + bitField0_ |= 0x00000002; + methodName_ = value; + onChanged(); return this; } public Builder clearMethodName() { - result.hasMethodName = false; - result.methodName_ = getDefaultInstance().getMethodName(); + bitField0_ = (bitField0_ & ~0x00000002); + methodName_ = getDefaultInstance().getMethodName(); + onChanged(); return this; } + void setMethodName(com.google.protobuf.ByteString value) { + bitField0_ |= 0x00000002; + methodName_ = value; + onChanged(); + } // optional bytes request_proto = 3; + private com.google.protobuf.ByteString requestProto_ = com.google.protobuf.ByteString.EMPTY; public boolean hasRequestProto() { - return result.hasRequestProto(); + return ((bitField0_ & 0x00000004) == 0x00000004); } public com.google.protobuf.ByteString getRequestProto() { - return result.getRequestProto(); + return requestProto_; } public Builder setRequestProto(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - result.hasRequestProto = true; - result.requestProto_ = value; + bitField0_ |= 0x00000004; + requestProto_ = value; + onChanged(); return this; } public Builder clearRequestProto() { - result.hasRequestProto = false; - result.requestProto_ = getDefaultInstance().getRequestProto(); + bitField0_ = (bitField0_ & ~0x00000004); + requestProto_ = getDefaultInstance().getRequestProto(); + onChanged(); return this; } // optional int64 request_id = 4; + private long requestId_ ; public boolean hasRequestId() { - return result.hasRequestId(); + return ((bitField0_ & 0x00000008) == 0x00000008); } public long getRequestId() { - return result.getRequestId(); + return requestId_; } public Builder setRequestId(long value) { - result.hasRequestId = true; - result.requestId_ = value; + bitField0_ |= 0x00000008; + requestId_ = value; + onChanged(); return this; } public Builder clearRequestId() { - result.hasRequestId = false; - result.requestId_ = 0L; + bitField0_ = (bitField0_ & ~0x00000008); + requestId_ = 0L; + onChanged(); return this; } @@ -411,18 +588,49 @@ public final class Data { static { defaultInstance = new Request(true); - com.orbekk.protobuf.Data.internalForceInit(); defaultInstance.initFields(); } // @@protoc_insertion_point(class_scope:com.orbekk.protobuf.Request) } + public interface ResponseOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // optional bytes response_proto = 1; + boolean hasResponseProto(); + com.google.protobuf.ByteString getResponseProto(); + + // optional .com.orbekk.protobuf.Response.RpcError error = 2; + boolean hasError(); + com.orbekk.protobuf.Data.Response.RpcError getError(); + + // optional int64 request_id = 5; + boolean hasRequestId(); + long getRequestId(); + + // optional bool hasFailed = 4; + boolean hasHasFailed(); + boolean getHasFailed(); + + // optional bool canceled = 6; + boolean hasCanceled(); + boolean getCanceled(); + + // optional bool done = 7 [default = true]; + boolean hasDone(); + boolean getDone(); + + // optional string error_text = 3; + boolean hasErrorText(); + String getErrorText(); + } public static final class Response extends - com.google.protobuf.GeneratedMessage { + com.google.protobuf.GeneratedMessage + implements ResponseOrBuilder { // Use Response.newBuilder() to construct. - private Response() { - initFields(); + private Response(Builder builder) { + super(builder); } private Response(boolean noInit) {} @@ -453,6 +661,11 @@ public final class Data { INVALID_PROTOBUF(3, 3), ; + public static final int UNKNOWN_SERVICE_VALUE = 0; + public static final int UNKNOWN_METHOD_VALUE = 1; + public static final int CANCELED_VALUE = 2; + public static final int INVALID_PROTOBUF_VALUE = 3; + public final int getNumber() { return value; } @@ -474,8 +687,8 @@ public final class Data { internalValueMap = new com.google.protobuf.Internal.EnumLiteMap<RpcError>() { public RpcError findValueByNumber(int number) { - return RpcError.valueOf(number) - ; } + return RpcError.valueOf(number); + } }; public final com.google.protobuf.Descriptors.EnumValueDescriptor @@ -494,6 +707,7 @@ public final class Data { private static final RpcError[] VALUES = { UNKNOWN_SERVICE, UNKNOWN_METHOD, CANCELED, INVALID_PROTOBUF, }; + public static RpcError valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { @@ -502,99 +716,152 @@ public final class Data { } return VALUES[desc.getIndex()]; } + private final int index; private final int value; + private RpcError(int index, int value) { this.index = index; this.value = value; } - static { - com.orbekk.protobuf.Data.getDescriptor(); - } - // @@protoc_insertion_point(enum_scope:com.orbekk.protobuf.Response.RpcError) } + private int bitField0_; // optional bytes response_proto = 1; public static final int RESPONSE_PROTO_FIELD_NUMBER = 1; - private boolean hasResponseProto; - private com.google.protobuf.ByteString responseProto_ = com.google.protobuf.ByteString.EMPTY; - public boolean hasResponseProto() { return hasResponseProto; } - public com.google.protobuf.ByteString getResponseProto() { return responseProto_; } + private com.google.protobuf.ByteString responseProto_; + public boolean hasResponseProto() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + public com.google.protobuf.ByteString getResponseProto() { + return responseProto_; + } // optional .com.orbekk.protobuf.Response.RpcError error = 2; public static final int ERROR_FIELD_NUMBER = 2; - private boolean hasError; private com.orbekk.protobuf.Data.Response.RpcError error_; - public boolean hasError() { return hasError; } - public com.orbekk.protobuf.Data.Response.RpcError getError() { return error_; } + public boolean hasError() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + public com.orbekk.protobuf.Data.Response.RpcError getError() { + return error_; + } // optional int64 request_id = 5; public static final int REQUEST_ID_FIELD_NUMBER = 5; - private boolean hasRequestId; - private long requestId_ = 0L; - public boolean hasRequestId() { return hasRequestId; } - public long getRequestId() { return requestId_; } + private long requestId_; + public boolean hasRequestId() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + public long getRequestId() { + return requestId_; + } // optional bool hasFailed = 4; public static final int HASFAILED_FIELD_NUMBER = 4; - private boolean hasHasFailed; - private boolean hasFailed_ = false; - public boolean hasHasFailed() { return hasHasFailed; } - public boolean getHasFailed() { return hasFailed_; } + private boolean hasFailed_; + public boolean hasHasFailed() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + public boolean getHasFailed() { + return hasFailed_; + } // optional bool canceled = 6; public static final int CANCELED_FIELD_NUMBER = 6; - private boolean hasCanceled; - private boolean canceled_ = false; - public boolean hasCanceled() { return hasCanceled; } - public boolean getCanceled() { return canceled_; } + private boolean canceled_; + public boolean hasCanceled() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + public boolean getCanceled() { + return canceled_; + } // optional bool done = 7 [default = true]; public static final int DONE_FIELD_NUMBER = 7; - private boolean hasDone; - private boolean done_ = true; - public boolean hasDone() { return hasDone; } - public boolean getDone() { return done_; } + private boolean done_; + public boolean hasDone() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + public boolean getDone() { + return done_; + } // optional string error_text = 3; public static final int ERROR_TEXT_FIELD_NUMBER = 3; - private boolean hasErrorText; - private java.lang.String errorText_ = ""; - public boolean hasErrorText() { return hasErrorText; } - public java.lang.String getErrorText() { return errorText_; } + private java.lang.Object errorText_; + public boolean hasErrorText() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + public String getErrorText() { + java.lang.Object ref = errorText_; + 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)) { + errorText_ = s; + } + return s; + } + } + private com.google.protobuf.ByteString getErrorTextBytes() { + java.lang.Object ref = errorText_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((String) ref); + errorText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } private void initFields() { + responseProto_ = com.google.protobuf.ByteString.EMPTY; error_ = com.orbekk.protobuf.Data.Response.RpcError.UNKNOWN_SERVICE; + requestId_ = 0L; + hasFailed_ = false; + canceled_ = false; + done_ = true; + errorText_ = ""; } + private byte memoizedIsInitialized = -1; public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + memoizedIsInitialized = 1; return true; } public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - if (hasResponseProto()) { - output.writeBytes(1, getResponseProto()); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, responseProto_); } - if (hasError()) { - output.writeEnum(2, getError().getNumber()); + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeEnum(2, error_.getNumber()); } - if (hasErrorText()) { - output.writeString(3, getErrorText()); + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeBytes(3, getErrorTextBytes()); } - if (hasHasFailed()) { - output.writeBool(4, getHasFailed()); + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeBool(4, hasFailed_); } - if (hasRequestId()) { - output.writeInt64(5, getRequestId()); + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeInt64(5, requestId_); } - if (hasCanceled()) { - output.writeBool(6, getCanceled()); + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeBool(6, canceled_); } - if (hasDone()) { - output.writeBool(7, getDone()); + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeBool(7, done_); } getUnknownFields().writeTo(output); } @@ -605,39 +872,46 @@ public final class Data { if (size != -1) return size; size = 0; - if (hasResponseProto()) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, getResponseProto()); + .computeBytesSize(1, responseProto_); } - if (hasError()) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, getError().getNumber()); + .computeEnumSize(2, error_.getNumber()); } - if (hasErrorText()) { + if (((bitField0_ & 0x00000040) == 0x00000040)) { size += com.google.protobuf.CodedOutputStream - .computeStringSize(3, getErrorText()); + .computeBytesSize(3, getErrorTextBytes()); } - if (hasHasFailed()) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream - .computeBoolSize(4, getHasFailed()); + .computeBoolSize(4, hasFailed_); } - if (hasRequestId()) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(5, getRequestId()); + .computeInt64Size(5, requestId_); } - if (hasCanceled()) { + if (((bitField0_ & 0x00000010) == 0x00000010)) { size += com.google.protobuf.CodedOutputStream - .computeBoolSize(6, getCanceled()); + .computeBoolSize(6, canceled_); } - if (hasDone()) { + if (((bitField0_ & 0x00000020) == 0x00000020)) { size += com.google.protobuf.CodedOutputStream - .computeBoolSize(7, getDone()); + .computeBoolSize(7, done_); } 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 com.orbekk.protobuf.Data.Response parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -712,34 +986,63 @@ public final class Data { } 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 com.orbekk.protobuf.Data.Response result; + com.google.protobuf.GeneratedMessage.Builder<Builder> + implements com.orbekk.protobuf.Data.ResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.orbekk.protobuf.Data.internal_static_com_orbekk_protobuf_Response_descriptor; + } - // Construct using com.orbekk.protobuf.Data.Response.newBuilder() - private Builder() {} + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.orbekk.protobuf.Data.internal_static_com_orbekk_protobuf_Response_fieldAccessorTable; + } - private static Builder create() { - Builder builder = new Builder(); - builder.result = new com.orbekk.protobuf.Data.Response(); - return builder; + // Construct using com.orbekk.protobuf.Data.Response.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); } - protected com.orbekk.protobuf.Data.Response internalGetResult() { - return result; + 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 com.orbekk.protobuf.Data.Response(); + super.clear(); + responseProto_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + error_ = com.orbekk.protobuf.Data.Response.RpcError.UNKNOWN_SERVICE; + bitField0_ = (bitField0_ & ~0x00000002); + requestId_ = 0L; + bitField0_ = (bitField0_ & ~0x00000004); + hasFailed_ = false; + bitField0_ = (bitField0_ & ~0x00000008); + canceled_ = false; + bitField0_ = (bitField0_ & ~0x00000010); + done_ = true; + bitField0_ = (bitField0_ & ~0x00000020); + errorText_ = ""; + bitField0_ = (bitField0_ & ~0x00000040); return this; } public Builder clone() { - return create().mergeFrom(result); + return create().mergeFrom(buildPartial()); } public com.google.protobuf.Descriptors.Descriptor @@ -751,33 +1054,59 @@ public final class Data { return com.orbekk.protobuf.Data.Response.getDefaultInstance(); } - public boolean isInitialized() { - return result.isInitialized(); - } public com.orbekk.protobuf.Data.Response build() { - if (result != null && !isInitialized()) { + com.orbekk.protobuf.Data.Response result = buildPartial(); + if (!result.isInitialized()) { throw newUninitializedMessageException(result); } - return buildPartial(); + return result; } private com.orbekk.protobuf.Data.Response buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { - if (!isInitialized()) { + com.orbekk.protobuf.Data.Response result = buildPartial(); + if (!result.isInitialized()) { throw newUninitializedMessageException( result).asInvalidProtocolBufferException(); } - return buildPartial(); + return result; } public com.orbekk.protobuf.Data.Response buildPartial() { - if (result == null) { - throw new IllegalStateException( - "build() has already been called on this Builder."); + com.orbekk.protobuf.Data.Response result = new com.orbekk.protobuf.Data.Response(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.responseProto_ = responseProto_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.error_ = error_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.requestId_ = requestId_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.hasFailed_ = hasFailed_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.canceled_ = canceled_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.done_ = done_; + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000040; } - com.orbekk.protobuf.Data.Response returnMe = result; - result = null; - return returnMe; + result.errorText_ = errorText_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; } public Builder mergeFrom(com.google.protobuf.Message other) { @@ -816,6 +1145,10 @@ public final class Data { return this; } + public final boolean isInitialized() { + return true; + } + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -828,17 +1161,20 @@ public final class Data { 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 10: { - setResponseProto(input.readBytes()); + bitField0_ |= 0x00000001; + responseProto_ = input.readBytes(); break; } case 16: { @@ -847,176 +1183,215 @@ public final class Data { if (value == null) { unknownFields.mergeVarintField(2, rawValue); } else { - setError(value); + bitField0_ |= 0x00000002; + error_ = value; } break; } case 26: { - setErrorText(input.readString()); + bitField0_ |= 0x00000040; + errorText_ = input.readBytes(); break; } case 32: { - setHasFailed(input.readBool()); + bitField0_ |= 0x00000008; + hasFailed_ = input.readBool(); break; } case 40: { - setRequestId(input.readInt64()); + bitField0_ |= 0x00000004; + requestId_ = input.readInt64(); break; } case 48: { - setCanceled(input.readBool()); + bitField0_ |= 0x00000010; + canceled_ = input.readBool(); break; } case 56: { - setDone(input.readBool()); + bitField0_ |= 0x00000020; + done_ = input.readBool(); break; } } } } + private int bitField0_; // optional bytes response_proto = 1; + private com.google.protobuf.ByteString responseProto_ = com.google.protobuf.ByteString.EMPTY; public boolean hasResponseProto() { - return result.hasResponseProto(); + return ((bitField0_ & 0x00000001) == 0x00000001); } public com.google.protobuf.ByteString getResponseProto() { - return result.getResponseProto(); + return responseProto_; } public Builder setResponseProto(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - result.hasResponseProto = true; - result.responseProto_ = value; + bitField0_ |= 0x00000001; + responseProto_ = value; + onChanged(); return this; } public Builder clearResponseProto() { - result.hasResponseProto = false; - result.responseProto_ = getDefaultInstance().getResponseProto(); + bitField0_ = (bitField0_ & ~0x00000001); + responseProto_ = getDefaultInstance().getResponseProto(); + onChanged(); return this; } // optional .com.orbekk.protobuf.Response.RpcError error = 2; + private com.orbekk.protobuf.Data.Response.RpcError error_ = com.orbekk.protobuf.Data.Response.RpcError.UNKNOWN_SERVICE; public boolean hasError() { - return result.hasError(); + return ((bitField0_ & 0x00000002) == 0x00000002); } public com.orbekk.protobuf.Data.Response.RpcError getError() { - return result.getError(); + return error_; } public Builder setError(com.orbekk.protobuf.Data.Response.RpcError value) { if (value == null) { throw new NullPointerException(); } - result.hasError = true; - result.error_ = value; + bitField0_ |= 0x00000002; + error_ = value; + onChanged(); return this; } public Builder clearError() { - result.hasError = false; - result.error_ = com.orbekk.protobuf.Data.Response.RpcError.UNKNOWN_SERVICE; + bitField0_ = (bitField0_ & ~0x00000002); + error_ = com.orbekk.protobuf.Data.Response.RpcError.UNKNOWN_SERVICE; + onChanged(); return this; } // optional int64 request_id = 5; + private long requestId_ ; public boolean hasRequestId() { - return result.hasRequestId(); + return ((bitField0_ & 0x00000004) == 0x00000004); } public long getRequestId() { - return result.getRequestId(); + return requestId_; } public Builder setRequestId(long value) { - result.hasRequestId = true; - result.requestId_ = value; + bitField0_ |= 0x00000004; + requestId_ = value; + onChanged(); return this; } public Builder clearRequestId() { - result.hasRequestId = false; - result.requestId_ = 0L; + bitField0_ = (bitField0_ & ~0x00000004); + requestId_ = 0L; + onChanged(); return this; } // optional bool hasFailed = 4; + private boolean hasFailed_ ; public boolean hasHasFailed() { - return result.hasHasFailed(); + return ((bitField0_ & 0x00000008) == 0x00000008); } public boolean getHasFailed() { - return result.getHasFailed(); + return hasFailed_; } public Builder setHasFailed(boolean value) { - result.hasHasFailed = true; - result.hasFailed_ = value; + bitField0_ |= 0x00000008; + hasFailed_ = value; + onChanged(); return this; } public Builder clearHasFailed() { - result.hasHasFailed = false; - result.hasFailed_ = false; + bitField0_ = (bitField0_ & ~0x00000008); + hasFailed_ = false; + onChanged(); return this; } // optional bool canceled = 6; + private boolean canceled_ ; public boolean hasCanceled() { - return result.hasCanceled(); + return ((bitField0_ & 0x00000010) == 0x00000010); } public boolean getCanceled() { - return result.getCanceled(); + return canceled_; } public Builder setCanceled(boolean value) { - result.hasCanceled = true; - result.canceled_ = value; + bitField0_ |= 0x00000010; + canceled_ = value; + onChanged(); return this; } public Builder clearCanceled() { - result.hasCanceled = false; - result.canceled_ = false; + bitField0_ = (bitField0_ & ~0x00000010); + canceled_ = false; + onChanged(); return this; } // optional bool done = 7 [default = true]; + private boolean done_ = true; public boolean hasDone() { - return result.hasDone(); + return ((bitField0_ & 0x00000020) == 0x00000020); } public boolean getDone() { - return result.getDone(); + return done_; } public Builder setDone(boolean value) { - result.hasDone = true; - result.done_ = value; + bitField0_ |= 0x00000020; + done_ = value; + onChanged(); return this; } public Builder clearDone() { - result.hasDone = false; - result.done_ = true; + bitField0_ = (bitField0_ & ~0x00000020); + done_ = true; + onChanged(); return this; } // optional string error_text = 3; + private java.lang.Object errorText_ = ""; public boolean hasErrorText() { - return result.hasErrorText(); - } - public java.lang.String getErrorText() { - return result.getErrorText(); + return ((bitField0_ & 0x00000040) == 0x00000040); + } + public String getErrorText() { + java.lang.Object ref = errorText_; + if (!(ref instanceof String)) { + String s = ((com.google.protobuf.ByteString) ref).toStringUtf8(); + errorText_ = s; + return s; + } else { + return (String) ref; + } } - public Builder setErrorText(java.lang.String value) { + public Builder setErrorText(String value) { if (value == null) { throw new NullPointerException(); } - result.hasErrorText = true; - result.errorText_ = value; + bitField0_ |= 0x00000040; + errorText_ = value; + onChanged(); return this; } public Builder clearErrorText() { - result.hasErrorText = false; - result.errorText_ = getDefaultInstance().getErrorText(); + bitField0_ = (bitField0_ & ~0x00000040); + errorText_ = getDefaultInstance().getErrorText(); + onChanged(); return this; } + void setErrorText(com.google.protobuf.ByteString value) { + bitField0_ |= 0x00000040; + errorText_ = value; + onChanged(); + } // @@protoc_insertion_point(builder_scope:com.orbekk.protobuf.Response) } static { defaultInstance = new Response(true); - com.orbekk.protobuf.Data.internalForceInit(); defaultInstance.initFields(); } @@ -1085,7 +1460,5 @@ public final class Data { }, assigner); } - public static void internalForceInit() {} - // @@protoc_insertion_point(outer_class_scope) } |