Class Status (2.32.0)

  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

Implements

StatusOrBuilder

Static Fields

CODE_FIELD_NUMBER

  public 
  
 static 
  
 final 
  
 int 
  
 CODE_FIELD_NUMBER 
 
Field Value
Type
Description
int

DETAILS_FIELD_NUMBER

  public 
  
 static 
  
 final 
  
 int 
  
 DETAILS_FIELD_NUMBER 
 
Field Value
Type
Description
int

MESSAGE_FIELD_NUMBER

  public 
  
 static 
  
 final 
  
 int 
  
 MESSAGE_FIELD_NUMBER 
 
Field Value
Type
Description
int

Static Methods

getDefaultInstance()

  public 
  
 static 
  
 Status 
  
 getDefaultInstance 
 () 
 
Returns
Type
Description

getDescriptor()

  public 
  
 static 
  
 final 
  
 Descriptors 
 . 
 Descriptor 
  
 getDescriptor 
 () 
 
Returns
Type
Description

newBuilder()

  public 
  
 static 
  
 Status 
 . 
 Builder 
  
 newBuilder 
 () 
 
Returns
Type
Description

newBuilder(Status prototype)

  public 
  
 static 
  
 Status 
 . 
 Builder 
  
 newBuilder 
 ( 
 Status 
  
 prototype 
 ) 
 
Parameter
Name
Description
prototype
Returns
Type
Description

parseDelimitedFrom(InputStream input)

  public 
  
 static 
  
 Status 
  
 parseDelimitedFrom 
 ( 
 InputStream 
  
 input 
 ) 
 
Parameter
Name
Description
input
Returns
Type
Description
Exceptions
Type
Description

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

  public 
  
 static 
  
 Status 
  
 parseDelimitedFrom 
 ( 
 InputStream 
  
 input 
 , 
  
 ExtensionRegistryLite 
  
 extensionRegistry 
 ) 
 
Parameters
Name
Description
input
extensionRegistry
Returns
Type
Description
Exceptions
Type
Description

parseFrom(byte[] data)

  public 
  
 static 
  
 Status 
  
 parseFrom 
 ( 
 byte 
 [] 
  
 data 
 ) 
 
Parameter
Name
Description
data
byte []
Returns
Type
Description
Exceptions
Type
Description

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

  public 
  
 static 
  
 Status 
  
 parseFrom 
 ( 
 byte 
 [] 
  
 data 
 , 
  
 ExtensionRegistryLite 
  
 extensionRegistry 
 ) 
 
Parameters
Name
Description
data
byte []
extensionRegistry
Returns
Type
Description
Exceptions
Type
Description

parseFrom(ByteString data)

  public 
  
 static 
  
 Status 
  
 parseFrom 
 ( 
 ByteString 
  
 data 
 ) 
 
Parameter
Name
Description
data
Returns
Type
Description
Exceptions
Type
Description

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

  public 
  
 static 
  
 Status 
  
 parseFrom 
 ( 
 ByteString 
  
 data 
 , 
  
 ExtensionRegistryLite 
  
 extensionRegistry 
 ) 
 
Parameters
Name
Description
data
extensionRegistry
Returns
Type
Description
Exceptions
Type
Description

parseFrom(CodedInputStream input)

  public 
  
 static 
  
 Status 
  
 parseFrom 
 ( 
 CodedInputStream 
  
 input 
 ) 
 
Parameter
Name
Description
Returns
Type
Description
Exceptions
Type
Description

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

  public 
  
 static 
  
 Status 
  
 parseFrom 
 ( 
 CodedInputStream 
  
 input 
 , 
  
 ExtensionRegistryLite 
  
 extensionRegistry 
 ) 
 
Parameters
Name
Description
extensionRegistry
Returns
Type
Description
Exceptions
Type
Description

parseFrom(InputStream input)

  public 
  
 static 
  
 Status 
  
 parseFrom 
 ( 
 InputStream 
  
 input 
 ) 
 
Parameter
Name
Description
input
Returns
Type
Description
Exceptions
Type
Description

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

  public 
  
 static 
  
 Status 
  
 parseFrom 
 ( 
 InputStream 
  
 input 
 , 
  
 ExtensionRegistryLite 
  
 extensionRegistry 
 ) 
 
Parameters
Name
Description
input
extensionRegistry
Returns
Type
Description
Exceptions
Type
Description

parseFrom(ByteBuffer data)

  public 
  
 static 
  
 Status 
  
 parseFrom 
 ( 
 ByteBuffer 
  
 data 
 ) 
 
Parameter
Name
Description
data
Returns
Type
Description
Exceptions
Type
Description

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

  public 
  
 static 
  
 Status 
  
 parseFrom 
 ( 
 ByteBuffer 
  
 data 
 , 
  
 ExtensionRegistryLite 
  
 extensionRegistry 
 ) 
 
Parameters
Name
Description
data
extensionRegistry
Returns
Type
Description
Exceptions
Type
Description

parser()

  public 
  
 static 
  
 Parser<Status> 
  
 parser 
 () 
 
Returns
Type
Description

Methods

equals(Object obj)

  public 
  
 boolean 
  
 equals 
 ( 
 Object 
  
 obj 
 ) 
 
Parameter
Name
Description
obj
Returns
Type
Description
Overrides

getCode()

  public 
  
 int 
  
 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
Type
Description

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
Name
Description
index
int
Returns
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;

Returns
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;

Returns
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;

Parameter
Name
Description
index
int
Returns
Type
Description

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

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
Type
Description

The bytes for message.

getParserForType()

  public 
  
 Parser<Status> 
  
 getParserForType 
 () 
 
Returns
Type
Description
Overrides

getSerializedSize()

  public 
  
 int 
  
 getSerializedSize 
 () 
 
Returns
Type
Description
int
Overrides

hashCode()

  public 
  
 int 
  
 hashCode 
 () 
 
Returns
Type
Description
int
Overrides

internalGetFieldAccessorTable()

  protected 
  
 GeneratedMessageV3 
 . 
 FieldAccessorTable 
  
 internalGetFieldAccessorTable 
 () 
 
Returns
Type
Description
Overrides

isInitialized()

  public 
  
 final 
  
 boolean 
  
 isInitialized 
 () 
 
Returns
Type
Description
Overrides

newBuilderForType()

  public 
  
 Status 
 . 
 Builder 
  
 newBuilderForType 
 () 
 
Returns
Type
Description

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

  protected 
  
 Status 
 . 
 Builder 
  
 newBuilderForType 
 ( 
 GeneratedMessageV3 
 . 
 BuilderParent 
  
 parent 
 ) 
 
Parameter
Name
Description
parent
Returns
Type
Description
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

  protected 
  
 Object 
  
 newInstance 
 ( 
 GeneratedMessageV3 
 . 
 UnusedPrivateParameter 
  
 unused 
 ) 
 
Parameter
Name
Description
Returns
Type
Description
Overrides

toBuilder()

  public 
  
 Status 
 . 
 Builder 
  
 toBuilder 
 () 
 
Returns
Type
Description

writeTo(CodedOutputStream output)

  public 
  
 void 
  
 writeTo 
 ( 
 CodedOutputStream 
  
 output 
 ) 
 
Parameter
Name
Description
Overrides
Exceptions
Type
Description
Design a Mobile Site
View Site in Mobile | Classic
Share by: