Send feedback
Class Status (2.13.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version 2.13.0 keyboard_arrow_down
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
Static Fields
CODE_FIELD_NUMBER
public static final int CODE_FIELD_NUMBER
Field Value
DETAILS_FIELD_NUMBER
public static final int DETAILS_FIELD_NUMBER
Field Value
MESSAGE_FIELD_NUMBER
public static final int MESSAGE_FIELD_NUMBER
Field Value
Static Methods
getDefaultInstance()
public static Status getDefaultInstance ()
Returns
getDescriptor()
public static final Descriptors . Descriptor getDescriptor ()
Returns
newBuilder()
public static Status . Builder newBuilder ()
Returns
newBuilder(Status prototype)
public static Status . Builder newBuilder ( Status prototype )
Parameter
Name Description prototype
Status
Returns
public static Status parseDelimitedFrom ( InputStream input )
Parameter
Returns
Exceptions
public static Status parseDelimitedFrom ( InputStream input , ExtensionRegistryLite extensionRegistry )
Parameters
Returns
Exceptions
parseFrom(byte[] data)
public static Status parseFrom ( byte [] data )
Parameter
Name Description data
byte []
Returns
Exceptions
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static Status parseFrom ( byte [] data , ExtensionRegistryLite extensionRegistry )
Parameters
Returns
Exceptions
parseFrom(ByteString data)
public static Status parseFrom ( ByteString data )
Parameter
Returns
Exceptions
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static Status parseFrom ( ByteString data , ExtensionRegistryLite extensionRegistry )
Parameters
Returns
Exceptions
public static Status parseFrom ( CodedInputStream input )
Parameter
Returns
Exceptions
public static Status parseFrom ( CodedInputStream input , ExtensionRegistryLite extensionRegistry )
Parameters
Returns
Exceptions
public static Status parseFrom ( InputStream input )
Parameter
Returns
Exceptions
public static Status parseFrom ( InputStream input , ExtensionRegistryLite extensionRegistry )
Parameters
Returns
Exceptions
parseFrom(ByteBuffer data)
public static Status parseFrom ( ByteBuffer data )
Parameter
Returns
Exceptions
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static Status parseFrom ( ByteBuffer data , ExtensionRegistryLite extensionRegistry )
Parameters
Returns
Exceptions
parser()
public static Parser<Status> parser ()
Returns
Methods
equals(Object obj)
public boolean equals ( Object obj )
Parameter
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
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
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
getParserForType()
public Parser<Status> getParserForType ()
Returns
Overrides
getSerializedSize()
public int getSerializedSize ()
Returns
Overrides
getUnknownFields()
public final UnknownFieldSet getUnknownFields ()
Returns
Overrides
hashCode()
Returns
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3 . FieldAccessorTable internalGetFieldAccessorTable ()
Returns
Overrides
isInitialized()
public final boolean isInitialized ()
Returns
Overrides
newBuilderForType()
public Status . Builder newBuilderForType ()
Returns
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected Status . Builder newBuilderForType ( GeneratedMessageV3 . BuilderParent parent )
Parameter
Returns
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance ( GeneratedMessageV3 . UnusedPrivateParameter unused )
Parameter
Returns
Overrides
toBuilder()
public Status . Builder toBuilder ()
Returns
writeTo(CodedOutputStream output)
public void writeTo ( CodedOutputStream output )
Parameter
Overrides
Exceptions
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-02-23 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-23 UTC."],[],[]]