Class Status.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder<MessageType,BuilderType>
com.google.protobuf.GeneratedMessageLite.Builder<Status,Status.Builder>
com.google.rpc.Status.Builder
All Implemented Interfaces:
com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, StatusOrBuilder, Cloneable
Enclosing class:
Status

public static final class Status.Builder extends com.google.protobuf.GeneratedMessageLite.Builder<Status,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
  • Field Summary

    Fields inherited from class com.google.protobuf.GeneratedMessageLite.Builder

    instance
  • Method Summary

    Modifier and Type
    Method
    Description
    addAllDetails(Iterable<? extends com.google.protobuf.Any> values)
    A list of messages that carry the error details.
    addDetails(int index, com.google.protobuf.Any value)
    A list of messages that carry the error details.
    addDetails(int index, com.google.protobuf.Any.Builder builderForValue)
    A list of messages that carry the error details.
    addDetails(com.google.protobuf.Any value)
    A list of messages that carry the error details.
    addDetails(com.google.protobuf.Any.Builder builderForValue)
    A list of messages that carry the error details.
    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
    The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
    com.google.protobuf.Any
    getDetails(int index)
    A list of messages that carry the error details.
    int
    A list of messages that carry the error details.
    List<com.google.protobuf.Any>
    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.
    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, com.google.protobuf.Any value)
    A list of messages that carry the error details.
    setDetails(int index, com.google.protobuf.Any.Builder builderForValue)
    A list of messages that carry the error details.
    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.GeneratedMessageLite.Builder

    build, buildPartial, clear, clone, copyOnWrite, copyOnWriteInternal, getDefaultInstanceForType, internalMergeFrom, isInitialized, mergeFrom, mergeFrom, mergeFrom, mergeFrom

    Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder

    addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.google.protobuf.MessageLiteOrBuilder

    getDefaultInstanceForType, isInitialized
  • Method Details

    • getCode

      public int getCode()
       The status code, which should be an enum value of
       [google.rpc.Code][google.rpc.Code].
       
      int32 code = 1 [json_name = "code"];
      Specified by:
      getCode in interface StatusOrBuilder
      Returns:
      The code.
    • setCode

      public Status.Builder setCode(int value)
       The status code, which should be an enum value of
       [google.rpc.Code][google.rpc.Code].
       
      int32 code = 1 [json_name = "code"];
      Parameters:
      value - The code to set.
      Returns:
      This builder for chaining.
    • clearCode

      public Status.Builder clearCode()
       The status code, which should be an enum value of
       [google.rpc.Code][google.rpc.Code].
       
      int32 code = 1 [json_name = "code"];
      Returns:
      This builder for chaining.
    • 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][google.rpc.Status.details] field, or localized
       by the client.
       
      string message = 2 [json_name = "message"];
      Specified by:
      getMessage in interface StatusOrBuilder
      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 [json_name = "message"];
      Specified by:
      getMessageBytes in interface StatusOrBuilder
      Returns:
      The bytes for message.
    • setMessage

      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][google.rpc.Status.details] field, or localized
       by the client.
       
      string message = 2 [json_name = "message"];
      Parameters:
      value - The message to set.
      Returns:
      This builder for chaining.
    • 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][google.rpc.Status.details] field, or localized
       by the client.
       
      string message = 2 [json_name = "message"];
      Returns:
      This builder for chaining.
    • setMessageBytes

      public Status.Builder setMessageBytes(com.google.protobuf.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][google.rpc.Status.details] field, or localized
       by the client.
       
      string message = 2 [json_name = "message"];
      Parameters:
      value - The bytes for message to set.
      Returns:
      This builder for chaining.
    • getDetailsList

      public List<com.google.protobuf.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 [json_name = "details"];
      Specified by:
      getDetailsList in interface StatusOrBuilder
    • 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 [json_name = "details"];
      Specified by:
      getDetailsCount in interface StatusOrBuilder
    • getDetails

      public com.google.protobuf.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 [json_name = "details"];
      Specified by:
      getDetails in interface StatusOrBuilder
    • setDetails

      public Status.Builder setDetails(int index, com.google.protobuf.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 [json_name = "details"];
    • setDetails

      public Status.Builder setDetails(int index, com.google.protobuf.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 [json_name = "details"];
    • addDetails

      public Status.Builder addDetails(com.google.protobuf.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 [json_name = "details"];
    • addDetails

      public Status.Builder addDetails(int index, com.google.protobuf.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 [json_name = "details"];
    • addDetails

      public Status.Builder addDetails(com.google.protobuf.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 [json_name = "details"];
    • addDetails

      public Status.Builder addDetails(int index, com.google.protobuf.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 [json_name = "details"];
    • addAllDetails

      public Status.Builder addAllDetails(Iterable<? extends com.google.protobuf.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 [json_name = "details"];
    • 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 [json_name = "details"];
    • removeDetails

      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 [json_name = "details"];