Class Status.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<Status.Builder>
com.google.protobuf.GeneratedMessage.Builder<Status.Builder>
com.google.rpc.Status.Builder
- All Implemented Interfaces:
com.google.protobuf.Message.Builder
,com.google.protobuf.MessageLite.Builder
,com.google.protobuf.MessageLiteOrBuilder
,com.google.protobuf.MessageOrBuilder
,StatusOrBuilder
,Cloneable
- Enclosing class:
Status
public static final class Status.Builder
extends com.google.protobuf.GeneratedMessage.Builder<Status.Builder>
implements StatusOrBuilder
The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).Protobuf type
google.rpc.Status
-
Method Summary
Modifier and TypeMethodDescriptionaddAllDetails
(Iterable<? extends Any> values) A list of messages that carry the error details.addDetails
(int index, Any value) A list of messages that carry the error details.addDetails
(int index, Any.Builder builderForValue) A list of messages that carry the error details.addDetails
(Any value) A list of messages that carry the error details.addDetails
(Any.Builder builderForValue) A list of messages that carry the error details.A list of messages that carry the error details.addDetailsBuilder
(int index) A list of messages that carry the error details.build()
clear()
The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].A list of messages that carry the error details.A developer-facing error message, which should be in English.int
getCode()
The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].static final com.google.protobuf.Descriptors.Descriptor
com.google.protobuf.Descriptors.Descriptor
getDetails
(int index) A list of messages that carry the error details.getDetailsBuilder
(int index) A list of messages that carry the error details.A list of messages that carry the error details.int
A list of messages that carry the error details.A list of messages that carry the error details.getDetailsOrBuilder
(int index) A list of messages that carry the error details.List
<? extends AnyOrBuilder> A list of messages that carry the error details.A developer-facing error message, which should be in English.com.google.protobuf.ByteString
A developer-facing error message, which should be in English.protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
final boolean
mergeFrom
(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom
(com.google.protobuf.Message other) removeDetails
(int index) A list of messages that carry the error details.setCode
(int value) The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].setDetails
(int index, Any value) A list of messages that carry the error details.setDetails
(int index, Any.Builder builderForValue) A list of messages that carry the error details.setMessage
(String value) A developer-facing error message, which should be in English.setMessageBytes
(com.google.protobuf.ByteString value) A developer-facing error message, which should be in English.Methods inherited from class com.google.protobuf.GeneratedMessage.Builder
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3
Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFrom
Methods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFrom
Methods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTable
in classcom.google.protobuf.GeneratedMessage.Builder<Status.Builder>
-
clear
- Specified by:
clear
in interfacecom.google.protobuf.Message.Builder
- Specified by:
clear
in interfacecom.google.protobuf.MessageLite.Builder
- Overrides:
clear
in classcom.google.protobuf.GeneratedMessage.Builder<Status.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForType
in interfacecom.google.protobuf.Message.Builder
- Specified by:
getDescriptorForType
in interfacecom.google.protobuf.MessageOrBuilder
- Overrides:
getDescriptorForType
in classcom.google.protobuf.GeneratedMessage.Builder<Status.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
build
in interfacecom.google.protobuf.Message.Builder
- Specified by:
build
in interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartial
in interfacecom.google.protobuf.Message.Builder
- Specified by:
buildPartial
in interfacecom.google.protobuf.MessageLite.Builder
-
mergeFrom
- Specified by:
mergeFrom
in interfacecom.google.protobuf.Message.Builder
- Overrides:
mergeFrom
in classcom.google.protobuf.AbstractMessage.Builder<Status.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitialized
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Overrides:
isInitialized
in classcom.google.protobuf.GeneratedMessage.Builder<Status.Builder>
-
mergeFrom
public Status.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFrom
in interfacecom.google.protobuf.Message.Builder
- Specified by:
mergeFrom
in interfacecom.google.protobuf.MessageLite.Builder
- Overrides:
mergeFrom
in classcom.google.protobuf.AbstractMessage.Builder<Status.Builder>
- Throws:
IOException
-
getCode
public int getCode()The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
int32 code = 1;
- Specified by:
getCode
in interfaceStatusOrBuilder
- Returns:
- The code.
-
setCode
The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
int32 code = 1;
- Parameters:
value
- The code to set.- Returns:
- This builder for chaining.
-
clearCode
The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
int32 code = 1;
- Returns:
- This builder for chaining.
-
getMessage
A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
string message = 2;
- Specified by:
getMessage
in interfaceStatusOrBuilder
- Returns:
- The message.
-
getMessageBytes
public com.google.protobuf.ByteString getMessageBytes()A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
string message = 2;
- Specified by:
getMessageBytes
in interfaceStatusOrBuilder
- Returns:
- The bytes for message.
-
setMessage
A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
string message = 2;
- Parameters:
value
- The message to set.- Returns:
- This builder for chaining.
-
clearMessage
A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
string message = 2;
- Returns:
- This builder for chaining.
-
setMessageBytes
A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
string message = 2;
- Parameters:
value
- The bytes for message to set.- Returns:
- This builder for chaining.
-
getDetailsList
A list of messages that carry the error details. There is a common set of message types for APIs to use.
repeated .google.protobuf.Any details = 3;
- Specified by:
getDetailsList
in interfaceStatusOrBuilder
-
getDetailsCount
public int getDetailsCount()A list of messages that carry the error details. There is a common set of message types for APIs to use.
repeated .google.protobuf.Any details = 3;
- Specified by:
getDetailsCount
in interfaceStatusOrBuilder
-
getDetails
A list of messages that carry the error details. There is a common set of message types for APIs to use.
repeated .google.protobuf.Any details = 3;
- Specified by:
getDetails
in interfaceStatusOrBuilder
-
setDetails
A list of messages that carry the error details. There is a common set of message types for APIs to use.
repeated .google.protobuf.Any details = 3;
-
setDetails
A list of messages that carry the error details. There is a common set of message types for APIs to use.
repeated .google.protobuf.Any details = 3;
-
addDetails
A list of messages that carry the error details. There is a common set of message types for APIs to use.
repeated .google.protobuf.Any details = 3;
-
addDetails
A list of messages that carry the error details. There is a common set of message types for APIs to use.
repeated .google.protobuf.Any details = 3;
-
addDetails
A list of messages that carry the error details. There is a common set of message types for APIs to use.
repeated .google.protobuf.Any details = 3;
-
addDetails
A list of messages that carry the error details. There is a common set of message types for APIs to use.
repeated .google.protobuf.Any details = 3;
-
addAllDetails
A list of messages that carry the error details. There is a common set of message types for APIs to use.
repeated .google.protobuf.Any details = 3;
-
clearDetails
A list of messages that carry the error details. There is a common set of message types for APIs to use.
repeated .google.protobuf.Any details = 3;
-
removeDetails
A list of messages that carry the error details. There is a common set of message types for APIs to use.
repeated .google.protobuf.Any details = 3;
-
getDetailsBuilder
A list of messages that carry the error details. There is a common set of message types for APIs to use.
repeated .google.protobuf.Any details = 3;
-
getDetailsOrBuilder
A list of messages that carry the error details. There is a common set of message types for APIs to use.
repeated .google.protobuf.Any details = 3;
- Specified by:
getDetailsOrBuilder
in interfaceStatusOrBuilder
-
getDetailsOrBuilderList
A list of messages that carry the error details. There is a common set of message types for APIs to use.
repeated .google.protobuf.Any details = 3;
- Specified by:
getDetailsOrBuilderList
in interfaceStatusOrBuilder
-
addDetailsBuilder
A list of messages that carry the error details. There is a common set of message types for APIs to use.
repeated .google.protobuf.Any details = 3;
-
addDetailsBuilder
A list of messages that carry the error details. There is a common set of message types for APIs to use.
repeated .google.protobuf.Any details = 3;
-
getDetailsBuilderList
A list of messages that carry the error details. There is a common set of message types for APIs to use.
repeated .google.protobuf.Any details = 3;
-