public final class Status extends GeneratedMessageV3 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
Inheritance
Object > AbstractMessageLite<MessageType,BuilderType> > AbstractMessage > GeneratedMessageV3 > StatusImplements
StatusOrBuilderStatic Fields
CODE_FIELD_NUMBER
public static final int CODE_FIELD_NUMBER
Type | Description |
int |
DETAILS_FIELD_NUMBER
public static final int DETAILS_FIELD_NUMBER
Type | Description |
int |
MESSAGE_FIELD_NUMBER
public static final int MESSAGE_FIELD_NUMBER
Type | Description |
int |
Static Methods
getDefaultInstance()
public static Status getDefaultInstance()
Type | Description |
Status |
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Type | Description |
Descriptor |
newBuilder()
public static Status.Builder newBuilder()
Type | Description |
Status.Builder |
newBuilder(Status prototype)
public static Status.Builder newBuilder(Status prototype)
Name | Description |
prototype | Status |
Type | Description |
Status.Builder |
parseDelimitedFrom(InputStream input)
public static Status parseDelimitedFrom(InputStream input)
Name | Description |
input | InputStream |
Type | Description |
Status |
Type | Description |
IOException |
parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
public static Status parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Name | Description |
input | InputStream |
extensionRegistry | ExtensionRegistryLite |
Type | Description |
Status |
Type | Description |
IOException |
parseFrom(byte[] data)
public static Status parseFrom(byte[] data)
Name | Description |
data | byte[] |
Type | Description |
Status |
Type | Description |
InvalidProtocolBufferException |
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static Status parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Name | Description |
data | byte[] |
extensionRegistry | ExtensionRegistryLite |
Type | Description |
Status |
Type | Description |
InvalidProtocolBufferException |
parseFrom(ByteString data)
public static Status parseFrom(ByteString data)
Name | Description |
data | ByteString |
Type | Description |
Status |
Type | Description |
InvalidProtocolBufferException |
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static Status parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Name | Description |
data | ByteString |
extensionRegistry | ExtensionRegistryLite |
Type | Description |
Status |
Type | Description |
InvalidProtocolBufferException |
parseFrom(CodedInputStream input)
public static Status parseFrom(CodedInputStream input)
Name | Description |
input | CodedInputStream |
Type | Description |
Status |
Type | Description |
IOException |
parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public static Status parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Name | Description |
input | CodedInputStream |
extensionRegistry | ExtensionRegistryLite |
Type | Description |
Status |
Type | Description |
IOException |
parseFrom(InputStream input)
public static Status parseFrom(InputStream input)
Name | Description |
input | InputStream |
Type | Description |
Status |
Type | Description |
IOException |
parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
public static Status parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Name | Description |
input | InputStream |
extensionRegistry | ExtensionRegistryLite |
Type | Description |
Status |
Type | Description |
IOException |
parseFrom(ByteBuffer data)
public static Status parseFrom(ByteBuffer data)
Name | Description |
data | ByteBuffer |
Type | Description |
Status |
Type | Description |
InvalidProtocolBufferException |
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static Status parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Name | Description |
data | ByteBuffer |
extensionRegistry | ExtensionRegistryLite |
Type | Description |
Status |
Type | Description |
InvalidProtocolBufferException |
parser()
public static Parser<Status> parser()
Type | Description |
Parser<Status> |
Methods
equals(Object obj)
public boolean equals(Object obj)
Name | Description |
obj | Object |
Type | Description |
boolean |
getCode()
public int getCode()
The status code, which should be an enum value of google.rpc.Code.
int32 code = 1;
Type | Description |
int | The code. |
getDefaultInstanceForType()
public Status getDefaultInstanceForType()
Type | Description |
Status |
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;
Name | Description |
index | int |
Type | Description |
Any |
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;
Type | Description |
int |
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;
Type | Description |
List<Any> |
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;
Name | Description |
index | int |
Type | Description |
AnyOrBuilder |
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;
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;
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;
Type | Description |
ByteString | The bytes for message. |
getParserForType()
public Parser<Status> getParserForType()
Type | Description |
Parser<Status> |
getSerializedSize()
public int getSerializedSize()
Type | Description |
int |
getUnknownFields()
public final UnknownFieldSet getUnknownFields()
Type | Description |
UnknownFieldSet |
hashCode()
public int hashCode()
Type | Description |
int |
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Type | Description |
FieldAccessorTable |
isInitialized()
public final boolean isInitialized()
Type | Description |
boolean |
newBuilderForType()
public Status.Builder newBuilderForType()
Type | Description |
Status.Builder |
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected Status.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Name | Description |
parent | BuilderParent |
Type | Description |
Status.Builder |
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Name | Description |
unused | UnusedPrivateParameter |
Type | Description |
Object |
toBuilder()
public Status.Builder toBuilder()
Type | Description |
Status.Builder |
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Name | Description |
output | CodedOutputStream |
Type | Description |
IOException |