public static final class Status.Builder extends GeneratedMessageV3.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. 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.
Protobuf type google.rpc.Status
Static Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns
Methods
addAllDetails(Iterable<? extends Any> values)
public Status.Builder addAllDetails(Iterable<? extends Any> values)
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;
Parameter
Name | Description |
values | Iterable<? extends com.google.protobuf.Any>
|
Returns
addDetails(Any value)
public Status.Builder addDetails(Any value)
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;
Parameter
Returns
addDetails(Any.Builder builderForValue)
public Status.Builder addDetails(Any.Builder builderForValue)
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;
Parameter
Name | Description |
builderForValue | Builder
|
Returns
addDetails(int index, Any value)
public Status.Builder addDetails(int index, Any value)
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;
Parameters
Name | Description |
index | int
|
value | Any
|
Returns
addDetails(int index, Any.Builder builderForValue)
public Status.Builder addDetails(int index, Any.Builder builderForValue)
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;
Parameters
Returns
addDetailsBuilder()
public Any.Builder 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;
Returns
addDetailsBuilder(int index)
public Any.Builder addDetailsBuilder(int index)
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;
Parameter
Returns
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public Status.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Returns
Overrides
build()
Returns
buildPartial()
public Status buildPartial()
Returns
clear()
public Status.Builder clear()
Returns
Overrides
clearCode()
public Status.Builder clearCode()
The status code, which should be an enum value of google.rpc.Code.
int32 code = 1;
Returns
clearDetails()
public Status.Builder 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;
Returns
clearField(Descriptors.FieldDescriptor field)
public Status.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Returns
Overrides
clearMessage()
public Status.Builder 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 field, or localized by the client.
string message = 2;
Returns
clearOneof(Descriptors.OneofDescriptor oneof)
public Status.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Returns
Overrides
clone()
public Status.Builder clone()
Returns
Overrides
getCode()
The status code, which should be an enum value of google.rpc.Code.
int32 code = 1;
Returns
Type | Description |
int | The code.
|
getDefaultInstanceForType()
public Status getDefaultInstanceForType()
Returns
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Returns
Overrides
getDetails(int index)
public Any getDetails(int index)
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;
Parameter
Returns
getDetailsBuilder(int index)
public Any.Builder getDetailsBuilder(int index)
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;
Parameter
Returns
getDetailsBuilderList()
public List<Any.Builder> 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;
Returns
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;
Returns
getDetailsList()
public List<Any> 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;
Returns
getDetailsOrBuilder(int index)
public AnyOrBuilder getDetailsOrBuilder(int index)
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;
Parameter
Returns
getDetailsOrBuilderList()
public List<? extends AnyOrBuilder> 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;
Returns
Type | Description |
List<? extends com.google.protobuf.AnyOrBuilder> | |
getMessage()
public String 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 field, or localized by the client.
string message = 2;
Returns
Type | Description |
String | The message.
|
getMessageBytes()
public 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 field, or localized by the client.
string message = 2;
Returns
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Overrides
isInitialized()
public final boolean isInitialized()
Returns
Overrides
public Status.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Overrides
Exceptions
mergeFrom(Message other)
public Status.Builder mergeFrom(Message other)
Parameter
Returns
Overrides
mergeFrom(Status other)
public Status.Builder mergeFrom(Status other)
Parameter
Returns
mergeUnknownFields(UnknownFieldSet unknownFields)
public final Status.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Returns
Overrides
removeDetails(int index)
public Status.Builder removeDetails(int index)
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;
Parameter
Returns
setCode(int value)
public Status.Builder setCode(int value)
The status code, which should be an enum value of google.rpc.Code.
int32 code = 1;
Parameter
Name | Description |
value | int
The code to set.
|
Returns
setDetails(int index, Any value)
public Status.Builder setDetails(int index, Any value)
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;
Parameters
Name | Description |
index | int
|
value | Any
|
Returns
setDetails(int index, Any.Builder builderForValue)
public Status.Builder setDetails(int index, Any.Builder builderForValue)
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;
Parameters
Returns
setField(Descriptors.FieldDescriptor field, Object value)
public Status.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Returns
Overrides
setMessage(String value)
public Status.Builder setMessage(String value)
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 field, or localized by the client.
string message = 2;
Parameter
Name | Description |
value | String
The message to set.
|
Returns
setMessageBytes(ByteString value)
public Status.Builder setMessageBytes(ByteString value)
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 field, or localized by the client.
string message = 2;
Parameter
Name | Description |
value | ByteString
The bytes for message to set.
|
Returns
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public Status.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Returns
Overrides
setUnknownFields(UnknownFieldSet unknownFields)
public final Status.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Returns
Overrides