http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/4d5919e5/proto_src/org/waveprotocol/wave/federation/FederationErrorProto.java
----------------------------------------------------------------------
diff --git
a/proto_src/org/waveprotocol/wave/federation/FederationErrorProto.java
b/proto_src/org/waveprotocol/wave/federation/FederationErrorProto.java
index e38fc2e..f87440a 100644
--- a/proto_src/org/waveprotocol/wave/federation/FederationErrorProto.java
+++ b/proto_src/org/waveprotocol/wave/federation/FederationErrorProto.java
@@ -1,21 +1,3 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: org/waveprotocol/wave/federation/federation_error.protodevel
@@ -26,50 +8,334 @@ public final class FederationErrorProto {
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
}
+ public interface FederationErrorOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // required .federation.FederationError.Code error_code = 1;
+ /**
+ * <code>required .federation.FederationError.Code error_code = 1;</code>
+ */
+ boolean hasErrorCode();
+ /**
+ * <code>required .federation.FederationError.Code error_code = 1;</code>
+ */
+ org.waveprotocol.wave.federation.FederationErrorProto.FederationError.Code
getErrorCode();
+
+ // optional string error_message = 2;
+ /**
+ * <code>optional string error_message = 2;</code>
+ */
+ boolean hasErrorMessage();
+ /**
+ * <code>optional string error_message = 2;</code>
+ */
+ java.lang.String getErrorMessage();
+ /**
+ * <code>optional string error_message = 2;</code>
+ */
+ com.google.protobuf.ByteString
+ getErrorMessageBytes();
+ }
+ /**
+ * Protobuf type {@code federation.FederationError}
+ *
+ * <pre>
+ **
+ * Container for a Federation error, containing the error code (as per the
+ * specification) and an optional description for debugging etc.
+ *
+ * The internal enum has codes which must map directly to XMPP error stanzas,
+ * as defined in RFC 3920 (9.3.3).
+ *
+ * TODO(arb): Once the error codes have been audited and standardised, merge
into federation.proto.
+ * </pre>
+ */
public static final class FederationError extends
- com.google.protobuf.GeneratedMessage {
+ com.google.protobuf.GeneratedMessage
+ implements FederationErrorOrBuilder {
// Use FederationError.newBuilder() to construct.
- private FederationError() {
- initFields();
+ private FederationError(com.google.protobuf.GeneratedMessage.Builder<?>
builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
}
- private FederationError(boolean noInit) {}
-
+ private FederationError(boolean noInit) { this.unknownFields =
com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
private static final FederationError defaultInstance;
public static FederationError getDefaultInstance() {
return defaultInstance;
}
-
+
public FederationError getDefaultInstanceForType() {
return defaultInstance;
}
-
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private FederationError(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 8: {
+ int rawValue = input.readEnum();
+
org.waveprotocol.wave.federation.FederationErrorProto.FederationError.Code
value =
org.waveprotocol.wave.federation.FederationErrorProto.FederationError.Code.valueOf(rawValue);
+ if (value == null) {
+ unknownFields.mergeVarintField(1, rawValue);
+ } else {
+ bitField0_ |= 0x00000001;
+ errorCode_ = value;
+ }
+ break;
+ }
+ case 18: {
+ bitField0_ |= 0x00000002;
+ errorMessage_ = input.readBytes();
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return
org.waveprotocol.wave.federation.FederationErrorProto.internal_static_federation_FederationError_descriptor;
}
-
+
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
- return
org.waveprotocol.wave.federation.FederationErrorProto.internal_static_federation_FederationError_fieldAccessorTable;
+ return
org.waveprotocol.wave.federation.FederationErrorProto.internal_static_federation_FederationError_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+
org.waveprotocol.wave.federation.FederationErrorProto.FederationError.class,
org.waveprotocol.wave.federation.FederationErrorProto.FederationError.Builder.class);
}
-
+
+ public static com.google.protobuf.Parser<FederationError> PARSER =
+ new com.google.protobuf.AbstractParser<FederationError>() {
+ public FederationError parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new FederationError(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<FederationError> getParserForType() {
+ return PARSER;
+ }
+
+ /**
+ * Protobuf enum {@code federation.FederationError.Code}
+ */
public enum Code
implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ * <code>OK = 0;</code>
+ *
+ * <pre>
+ * Should only be used for internal success.
+ * </pre>
+ */
OK(0, 0),
+ /**
+ * <code>BAD_REQUEST = 1;</code>
+ *
+ * <pre>
+ * Response for a completely broken request.
+ * </pre>
+ */
BAD_REQUEST(1, 1),
+ /**
+ * <code>ITEM_NOT_FOUND = 2;</code>
+ *
+ * <pre>
+ * Either the wavelet does not exist, or the request is not authorised
and
+ * thus should not reveal the existence of the target wavelet.
+ * </pre>
+ */
ITEM_NOT_FOUND(2, 2),
+ /**
+ * <code>NOT_ACCEPTABLE = 3;</code>
+ *
+ * <pre>
+ * Revealable error conditions; including, but not limited to:
+ * + submit failed due to invalid delta
+ * + invalid signer info post
+ * </pre>
+ */
NOT_ACCEPTABLE(3, 3),
+ /**
+ * <code>NOT_AUTHORIZED = 4;</code>
+ *
+ * <pre>
+ * Signer info not available for delta submit.
+ * </pre>
+ */
NOT_AUTHORIZED(4, 4),
+ /**
+ * <code>RESOURCE_CONSTRAINT = 5;</code>
+ *
+ * <pre>
+ * Generic 'back-off' message.
+ * </pre>
+ */
RESOURCE_CONSTRAINT(5, 5),
+ /**
+ * <code>UNDEFINED_CONDITION = 6;</code>
+ *
+ * <pre>
+ * Undefined condition. This error will be generated if an error
condition
+ * not otherwise contained within this protobuf is received
over-the-wire.
+ * </pre>
+ */
UNDEFINED_CONDITION(6, 6),
+ /**
+ * <code>REMOTE_SERVER_TIMEOUT = 7;</code>
+ *
+ * <pre>
+ * Timeout error condition. Note that this may be generated internally
+ * as well as being valid on-the-wire.
+ * </pre>
+ */
REMOTE_SERVER_TIMEOUT(7, 7),
+ /**
+ * <code>UNEXPECTED_REQUEST = 8;</code>
+ *
+ * <pre>
+ * Request unexpected, wait requested. Note that this may be generated
+ * internally, notably if an in-flight ID is re-used.
+ * </pre>
+ */
UNEXPECTED_REQUEST(8, 8),
+ /**
+ * <code>INTERNAL_SERVER_ERROR = 9;</code>
+ *
+ * <pre>
+ * Internal server error, wait requested.
+ * </pre>
+ */
INTERNAL_SERVER_ERROR(9, 9),
;
-
-
+
+ /**
+ * <code>OK = 0;</code>
+ *
+ * <pre>
+ * Should only be used for internal success.
+ * </pre>
+ */
+ public static final int OK_VALUE = 0;
+ /**
+ * <code>BAD_REQUEST = 1;</code>
+ *
+ * <pre>
+ * Response for a completely broken request.
+ * </pre>
+ */
+ public static final int BAD_REQUEST_VALUE = 1;
+ /**
+ * <code>ITEM_NOT_FOUND = 2;</code>
+ *
+ * <pre>
+ * Either the wavelet does not exist, or the request is not authorised
and
+ * thus should not reveal the existence of the target wavelet.
+ * </pre>
+ */
+ public static final int ITEM_NOT_FOUND_VALUE = 2;
+ /**
+ * <code>NOT_ACCEPTABLE = 3;</code>
+ *
+ * <pre>
+ * Revealable error conditions; including, but not limited to:
+ * + submit failed due to invalid delta
+ * + invalid signer info post
+ * </pre>
+ */
+ public static final int NOT_ACCEPTABLE_VALUE = 3;
+ /**
+ * <code>NOT_AUTHORIZED = 4;</code>
+ *
+ * <pre>
+ * Signer info not available for delta submit.
+ * </pre>
+ */
+ public static final int NOT_AUTHORIZED_VALUE = 4;
+ /**
+ * <code>RESOURCE_CONSTRAINT = 5;</code>
+ *
+ * <pre>
+ * Generic 'back-off' message.
+ * </pre>
+ */
+ public static final int RESOURCE_CONSTRAINT_VALUE = 5;
+ /**
+ * <code>UNDEFINED_CONDITION = 6;</code>
+ *
+ * <pre>
+ * Undefined condition. This error will be generated if an error
condition
+ * not otherwise contained within this protobuf is received
over-the-wire.
+ * </pre>
+ */
+ public static final int UNDEFINED_CONDITION_VALUE = 6;
+ /**
+ * <code>REMOTE_SERVER_TIMEOUT = 7;</code>
+ *
+ * <pre>
+ * Timeout error condition. Note that this may be generated internally
+ * as well as being valid on-the-wire.
+ * </pre>
+ */
+ public static final int REMOTE_SERVER_TIMEOUT_VALUE = 7;
+ /**
+ * <code>UNEXPECTED_REQUEST = 8;</code>
+ *
+ * <pre>
+ * Request unexpected, wait requested. Note that this may be generated
+ * internally, notably if an in-flight ID is re-used.
+ * </pre>
+ */
+ public static final int UNEXPECTED_REQUEST_VALUE = 8;
+ /**
+ * <code>INTERNAL_SERVER_ERROR = 9;</code>
+ *
+ * <pre>
+ * Internal server error, wait requested.
+ * </pre>
+ */
+ public static final int INTERNAL_SERVER_ERROR_VALUE = 9;
+
+
public final int getNumber() { return value; }
-
+
public static Code valueOf(int value) {
switch (value) {
case 0: return OK;
@@ -85,7 +351,7 @@ public final class FederationErrorProto {
default: return null;
}
}
-
+
public static com.google.protobuf.Internal.EnumLiteMap<Code>
internalGetValueMap() {
return internalValueMap;
@@ -94,10 +360,10 @@ public final class FederationErrorProto {
internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap<Code>() {
public Code findValueByNumber(int number) {
- return Code.valueOf(number)
- ; }
+ return Code.valueOf(number);
+ }
};
-
+
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(index);
@@ -110,10 +376,9 @@ public final class FederationErrorProto {
getDescriptor() {
return
org.waveprotocol.wave.federation.FederationErrorProto.FederationError.getDescriptor().getEnumTypes().get(0);
}
-
- private static final Code[] VALUES = {
- OK, BAD_REQUEST, ITEM_NOT_FOUND, NOT_ACCEPTABLE, NOT_AUTHORIZED,
RESOURCE_CONSTRAINT, UNDEFINED_CONDITION, REMOTE_SERVER_TIMEOUT,
UNEXPECTED_REQUEST, INTERNAL_SERVER_ERROR,
- };
+
+ private static final Code[] VALUES = values();
+
public static Code valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
@@ -122,215 +387,293 @@ public final class FederationErrorProto {
}
return VALUES[desc.getIndex()];
}
+
private final int index;
private final int value;
+
private Code(int index, int value) {
this.index = index;
this.value = value;
}
-
- static {
- org.waveprotocol.wave.federation.FederationErrorProto.getDescriptor();
- }
-
+
// @@protoc_insertion_point(enum_scope:federation.FederationError.Code)
}
-
+
+ private int bitField0_;
// required .federation.FederationError.Code error_code = 1;
public static final int ERROR_CODE_FIELD_NUMBER = 1;
- private boolean hasErrorCode;
private
org.waveprotocol.wave.federation.FederationErrorProto.FederationError.Code
errorCode_;
- public boolean hasErrorCode() { return hasErrorCode; }
- public
org.waveprotocol.wave.federation.FederationErrorProto.FederationError.Code
getErrorCode() { return errorCode_; }
-
+ /**
+ * <code>required .federation.FederationError.Code error_code = 1;</code>
+ */
+ public boolean hasErrorCode() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required .federation.FederationError.Code error_code = 1;</code>
+ */
+ public
org.waveprotocol.wave.federation.FederationErrorProto.FederationError.Code
getErrorCode() {
+ return errorCode_;
+ }
+
// optional string error_message = 2;
public static final int ERROR_MESSAGE_FIELD_NUMBER = 2;
- private boolean hasErrorMessage;
- private java.lang.String errorMessage_ = "";
- public boolean hasErrorMessage() { return hasErrorMessage; }
- public java.lang.String getErrorMessage() { return errorMessage_; }
-
+ private java.lang.Object errorMessage_;
+ /**
+ * <code>optional string error_message = 2;</code>
+ */
+ public boolean hasErrorMessage() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>optional string error_message = 2;</code>
+ */
+ public java.lang.String getErrorMessage() {
+ java.lang.Object ref = errorMessage_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ errorMessage_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <code>optional string error_message = 2;</code>
+ */
+ public com.google.protobuf.ByteString
+ getErrorMessageBytes() {
+ java.lang.Object ref = errorMessage_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ errorMessage_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
private void initFields() {
errorCode_ =
org.waveprotocol.wave.federation.FederationErrorProto.FederationError.Code.OK;
+ errorMessage_ = "";
}
+ private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
- if (!hasErrorCode) return false;
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (!hasErrorCode()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
return true;
}
-
+
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
- if (hasErrorCode()) {
- output.writeEnum(1, getErrorCode().getNumber());
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeEnum(1, errorCode_.getNumber());
}
- if (hasErrorMessage()) {
- output.writeString(2, getErrorMessage());
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ output.writeBytes(2, getErrorMessageBytes());
}
getUnknownFields().writeTo(output);
}
-
+
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
-
+
size = 0;
- if (hasErrorCode()) {
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
- .computeEnumSize(1, getErrorCode().getNumber());
+ .computeEnumSize(1, errorCode_.getNumber());
}
- if (hasErrorMessage()) {
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
- .computeStringSize(2, getErrorMessage());
+ .computeBytesSize(2, getErrorMessageBytes());
}
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
org.waveprotocol.wave.federation.FederationErrorProto.FederationError parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
- return newBuilder().mergeFrom(data).buildParsed();
+ return PARSER.parseFrom(data);
}
public static
org.waveprotocol.wave.federation.FederationErrorProto.FederationError parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
- return newBuilder().mergeFrom(data, extensionRegistry)
- .buildParsed();
+ return PARSER.parseFrom(data, extensionRegistry);
}
public static
org.waveprotocol.wave.federation.FederationErrorProto.FederationError
parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
- return newBuilder().mergeFrom(data).buildParsed();
+ return PARSER.parseFrom(data);
}
public static
org.waveprotocol.wave.federation.FederationErrorProto.FederationError parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
- return newBuilder().mergeFrom(data, extensionRegistry)
- .buildParsed();
+ return PARSER.parseFrom(data, extensionRegistry);
}
public static
org.waveprotocol.wave.federation.FederationErrorProto.FederationError
parseFrom(java.io.InputStream input)
throws java.io.IOException {
- return newBuilder().mergeFrom(input).buildParsed();
+ return PARSER.parseFrom(input);
}
public static
org.waveprotocol.wave.federation.FederationErrorProto.FederationError parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
- return newBuilder().mergeFrom(input, extensionRegistry)
- .buildParsed();
+ return PARSER.parseFrom(input, extensionRegistry);
}
public static
org.waveprotocol.wave.federation.FederationErrorProto.FederationError
parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
- Builder builder = newBuilder();
- if (builder.mergeDelimitedFrom(input)) {
- return builder.buildParsed();
- } else {
- return null;
- }
+ return PARSER.parseDelimitedFrom(input);
}
public static
org.waveprotocol.wave.federation.FederationErrorProto.FederationError
parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
- Builder builder = newBuilder();
- if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
- return builder.buildParsed();
- } else {
- return null;
- }
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static
org.waveprotocol.wave.federation.FederationErrorProto.FederationError parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
- return newBuilder().mergeFrom(input).buildParsed();
+ return PARSER.parseFrom(input);
}
public static
org.waveprotocol.wave.federation.FederationErrorProto.FederationError parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
- return newBuilder().mergeFrom(input, extensionRegistry)
- .buildParsed();
+ return PARSER.parseFrom(input, extensionRegistry);
}
-
+
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder
newBuilder(org.waveprotocol.wave.federation.FederationErrorProto.FederationError
prototype) {
return newBuilder().mergeFrom(prototype);
}
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;
+ }
+ /**
+ * Protobuf type {@code federation.FederationError}
+ *
+ * <pre>
+ **
+ * Container for a Federation error, containing the error code (as per the
+ * specification) and an optional description for debugging etc.
+ *
+ * The internal enum has codes which must map directly to XMPP error
stanzas,
+ * as defined in RFC 3920 (9.3.3).
+ *
+ * TODO(arb): Once the error codes have been audited and standardised,
merge into federation.proto.
+ * </pre>
+ */
public static final class Builder extends
- com.google.protobuf.GeneratedMessage.Builder<Builder> {
- private
org.waveprotocol.wave.federation.FederationErrorProto.FederationError result;
-
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements
org.waveprotocol.wave.federation.FederationErrorProto.FederationErrorOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return
org.waveprotocol.wave.federation.FederationErrorProto.internal_static_federation_FederationError_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return
org.waveprotocol.wave.federation.FederationErrorProto.internal_static_federation_FederationError_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+
org.waveprotocol.wave.federation.FederationErrorProto.FederationError.class,
org.waveprotocol.wave.federation.FederationErrorProto.FederationError.Builder.class);
+ }
+
// Construct using
org.waveprotocol.wave.federation.FederationErrorProto.FederationError.newBuilder()
- private Builder() {}
-
- private static Builder create() {
- Builder builder = new Builder();
- builder.result = new
org.waveprotocol.wave.federation.FederationErrorProto.FederationError();
- return builder;
+ private Builder() {
+ maybeForceBuilderInitialization();
}
-
- protected
org.waveprotocol.wave.federation.FederationErrorProto.FederationError
internalGetResult() {
- return result;
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
}
-
- public Builder clear() {
- if (result == null) {
- throw new IllegalStateException(
- "Cannot call clear() after build().");
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
- result = new
org.waveprotocol.wave.federation.FederationErrorProto.FederationError();
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ errorCode_ =
org.waveprotocol.wave.federation.FederationErrorProto.FederationError.Code.OK;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ errorMessage_ = "";
+ bitField0_ = (bitField0_ & ~0x00000002);
return this;
}
-
+
public Builder clone() {
- return create().mergeFrom(result);
+ return create().mergeFrom(buildPartial());
}
-
+
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
- return
org.waveprotocol.wave.federation.FederationErrorProto.FederationError.getDescriptor();
+ return
org.waveprotocol.wave.federation.FederationErrorProto.internal_static_federation_FederationError_descriptor;
}
-
+
public
org.waveprotocol.wave.federation.FederationErrorProto.FederationError
getDefaultInstanceForType() {
return
org.waveprotocol.wave.federation.FederationErrorProto.FederationError.getDefaultInstance();
}
-
- public boolean isInitialized() {
- return result.isInitialized();
- }
+
public
org.waveprotocol.wave.federation.FederationErrorProto.FederationError build() {
- if (result != null && !isInitialized()) {
+ org.waveprotocol.wave.federation.FederationErrorProto.FederationError
result = buildPartial();
+ if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
- return buildPartial();
- }
-
- private
org.waveprotocol.wave.federation.FederationErrorProto.FederationError
buildParsed()
- throws com.google.protobuf.InvalidProtocolBufferException {
- if (!isInitialized()) {
- throw newUninitializedMessageException(
- result).asInvalidProtocolBufferException();
- }
- return buildPartial();
+ return result;
}
-
+
public
org.waveprotocol.wave.federation.FederationErrorProto.FederationError
buildPartial() {
- if (result == null) {
- throw new IllegalStateException(
- "build() has already been called on this Builder.");
+ org.waveprotocol.wave.federation.FederationErrorProto.FederationError
result = new
org.waveprotocol.wave.federation.FederationErrorProto.FederationError(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
}
- org.waveprotocol.wave.federation.FederationErrorProto.FederationError
returnMe = result;
- result = null;
- return returnMe;
+ result.errorCode_ = errorCode_;
+ if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
+ to_bitField0_ |= 0x00000002;
+ }
+ result.errorMessage_ = errorMessage_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
}
-
+
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof
org.waveprotocol.wave.federation.FederationErrorProto.FederationError) {
return
mergeFrom((org.waveprotocol.wave.federation.FederationErrorProto.FederationError)other);
@@ -339,119 +682,175 @@ public final class FederationErrorProto {
return this;
}
}
-
+
public Builder
mergeFrom(org.waveprotocol.wave.federation.FederationErrorProto.FederationError
other) {
if (other ==
org.waveprotocol.wave.federation.FederationErrorProto.FederationError.getDefaultInstance())
return this;
if (other.hasErrorCode()) {
setErrorCode(other.getErrorCode());
}
if (other.hasErrorMessage()) {
- setErrorMessage(other.getErrorMessage());
+ bitField0_ |= 0x00000002;
+ errorMessage_ = other.errorMessage_;
+ onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
-
+
+ public final boolean isInitialized() {
+ if (!hasErrorCode()) {
+
+ return false;
+ }
+ return true;
+ }
+
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
- com.google.protobuf.UnknownFieldSet.Builder unknownFields =
- com.google.protobuf.UnknownFieldSet.newBuilder(
- this.getUnknownFields());
- while (true) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- this.setUnknownFields(unknownFields.build());
- return this;
- default: {
- if (!parseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.setUnknownFields(unknownFields.build());
- return this;
- }
- break;
- }
- case 8: {
- int rawValue = input.readEnum();
-
org.waveprotocol.wave.federation.FederationErrorProto.FederationError.Code
value =
org.waveprotocol.wave.federation.FederationErrorProto.FederationError.Code.valueOf(rawValue);
- if (value == null) {
- unknownFields.mergeVarintField(1, rawValue);
- } else {
- setErrorCode(value);
- }
- break;
- }
- case 18: {
- setErrorMessage(input.readString());
- break;
- }
+ org.waveprotocol.wave.federation.FederationErrorProto.FederationError
parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage =
(org.waveprotocol.wave.federation.FederationErrorProto.FederationError)
e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
}
}
+ return this;
}
-
-
+ private int bitField0_;
+
// required .federation.FederationError.Code error_code = 1;
+ private
org.waveprotocol.wave.federation.FederationErrorProto.FederationError.Code
errorCode_ =
org.waveprotocol.wave.federation.FederationErrorProto.FederationError.Code.OK;
+ /**
+ * <code>required .federation.FederationError.Code error_code = 1;</code>
+ */
public boolean hasErrorCode() {
- return result.hasErrorCode();
+ return ((bitField0_ & 0x00000001) == 0x00000001);
}
+ /**
+ * <code>required .federation.FederationError.Code error_code = 1;</code>
+ */
public
org.waveprotocol.wave.federation.FederationErrorProto.FederationError.Code
getErrorCode() {
- return result.getErrorCode();
+ return errorCode_;
}
+ /**
+ * <code>required .federation.FederationError.Code error_code = 1;</code>
+ */
public Builder
setErrorCode(org.waveprotocol.wave.federation.FederationErrorProto.FederationError.Code
value) {
if (value == null) {
throw new NullPointerException();
}
- result.hasErrorCode = true;
- result.errorCode_ = value;
+ bitField0_ |= 0x00000001;
+ errorCode_ = value;
+ onChanged();
return this;
}
+ /**
+ * <code>required .federation.FederationError.Code error_code = 1;</code>
+ */
public Builder clearErrorCode() {
- result.hasErrorCode = false;
- result.errorCode_ =
org.waveprotocol.wave.federation.FederationErrorProto.FederationError.Code.OK;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ errorCode_ =
org.waveprotocol.wave.federation.FederationErrorProto.FederationError.Code.OK;
+ onChanged();
return this;
}
-
+
// optional string error_message = 2;
+ private java.lang.Object errorMessage_ = "";
+ /**
+ * <code>optional string error_message = 2;</code>
+ */
public boolean hasErrorMessage() {
- return result.hasErrorMessage();
+ return ((bitField0_ & 0x00000002) == 0x00000002);
}
+ /**
+ * <code>optional string error_message = 2;</code>
+ */
public java.lang.String getErrorMessage() {
- return result.getErrorMessage();
+ java.lang.Object ref = errorMessage_;
+ if (!(ref instanceof java.lang.String)) {
+ java.lang.String s = ((com.google.protobuf.ByteString) ref)
+ .toStringUtf8();
+ errorMessage_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
}
- public Builder setErrorMessage(java.lang.String value) {
+ /**
+ * <code>optional string error_message = 2;</code>
+ */
+ public com.google.protobuf.ByteString
+ getErrorMessageBytes() {
+ java.lang.Object ref = errorMessage_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ errorMessage_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <code>optional string error_message = 2;</code>
+ */
+ public Builder setErrorMessage(
+ java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
- result.hasErrorMessage = true;
- result.errorMessage_ = value;
+ bitField0_ |= 0x00000002;
+ errorMessage_ = value;
+ onChanged();
return this;
}
+ /**
+ * <code>optional string error_message = 2;</code>
+ */
public Builder clearErrorMessage() {
- result.hasErrorMessage = false;
- result.errorMessage_ = getDefaultInstance().getErrorMessage();
+ bitField0_ = (bitField0_ & ~0x00000002);
+ errorMessage_ = getDefaultInstance().getErrorMessage();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional string error_message = 2;</code>
+ */
+ public Builder setErrorMessageBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000002;
+ errorMessage_ = value;
+ onChanged();
return this;
}
-
+
// @@protoc_insertion_point(builder_scope:federation.FederationError)
}
-
+
static {
defaultInstance = new FederationError(true);
-
org.waveprotocol.wave.federation.FederationErrorProto.internalForceInit();
defaultInstance.initFields();
}
-
+
// @@protoc_insertion_point(class_scope:federation.FederationError)
}
-
+
private static com.google.protobuf.Descriptors.Descriptor
internal_static_federation_FederationError_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_federation_FederationError_fieldAccessorTable;
-
+
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
@@ -483,9 +882,7 @@ public final class FederationErrorProto {
internal_static_federation_FederationError_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_federation_FederationError_descriptor,
- new java.lang.String[] { "ErrorCode", "ErrorMessage", },
-
org.waveprotocol.wave.federation.FederationErrorProto.FederationError.class,
-
org.waveprotocol.wave.federation.FederationErrorProto.FederationError.Builder.class);
+ new java.lang.String[] { "ErrorCode", "ErrorMessage", });
return null;
}
};
@@ -494,8 +891,6 @@ public final class FederationErrorProto {
new com.google.protobuf.Descriptors.FileDescriptor[] {
}, assigner);
}
-
- public static void internalForceInit() {}
-
+
// @@protoc_insertion_point(outer_class_scope)
}