Class Status.Builder (1.43.0)

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.cloud.compute.v1.Status

Implements

StatusOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

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 = 483979842;

Parameter
NameDescription
valuesIterable<? extends com.google.protobuf.Any>
Returns
TypeDescription
Status.Builder

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 = 483979842;

Parameter
NameDescription
valueAny
Returns
TypeDescription
Status.Builder

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 = 483979842;

Parameter
NameDescription
builderForValueBuilder
Returns
TypeDescription
Status.Builder

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 = 483979842;

Parameters
NameDescription
indexint
valueAny
Returns
TypeDescription
Status.Builder

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 = 483979842;

Parameters
NameDescription
indexint
builderForValueBuilder
Returns
TypeDescription
Status.Builder

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 = 483979842;

Returns
TypeDescription
Builder

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 = 483979842;

Parameter
NameDescription
indexint
Returns
TypeDescription
Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Status.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Status.Builder
Overrides

build()

public Status build()
Returns
TypeDescription
Status

buildPartial()

public Status buildPartial()
Returns
TypeDescription
Status

clear()

public Status.Builder clear()
Returns
TypeDescription
Status.Builder
Overrides

clearCode()

public Status.Builder clearCode()

The status code, which should be an enum value of google.rpc.Code.

optional int32 code = 3059181;

Returns
TypeDescription
Status.Builder

This builder for chaining.

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 = 483979842;

Returns
TypeDescription
Status.Builder

clearField(Descriptors.FieldDescriptor field)

public Status.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
Status.Builder
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.

optional string message = 418054151;

Returns
TypeDescription
Status.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Status.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
Status.Builder
Overrides

clone()

public Status.Builder clone()
Returns
TypeDescription
Status.Builder
Overrides

getCode()

public int getCode()

The status code, which should be an enum value of google.rpc.Code.

optional int32 code = 3059181;

Returns
TypeDescription
int

The code.

getDefaultInstanceForType()

public Status getDefaultInstanceForType()
Returns
TypeDescription
Status

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
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 = 483979842;

Parameter
NameDescription
indexint
Returns
TypeDescription
Any

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 = 483979842;

Parameter
NameDescription
indexint
Returns
TypeDescription
Builder

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 = 483979842;

Returns
TypeDescription
List<Builder>

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 = 483979842;

Returns
TypeDescription
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 = 483979842;

Returns
TypeDescription
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 = 483979842;

Parameter
NameDescription
indexint
Returns
TypeDescription
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 = 483979842;

Returns
TypeDescription
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.

optional string message = 418054151;

Returns
TypeDescription
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.

optional string message = 418054151;

Returns
TypeDescription
ByteString

The bytes for message.

hasCode()

public boolean hasCode()

The status code, which should be an enum value of google.rpc.Code.

optional int32 code = 3059181;

Returns
TypeDescription
boolean

Whether the code field is set.

hasMessage()

public boolean hasMessage()

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.

optional string message = 418054151;

Returns
TypeDescription
boolean

Whether the message field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(Status other)

public Status.Builder mergeFrom(Status other)
Parameter
NameDescription
otherStatus
Returns
TypeDescription
Status.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Status.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Status.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public Status.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
Status.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Status.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Status.Builder
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 = 483979842;

Parameter
NameDescription
indexint
Returns
TypeDescription
Status.Builder

setCode(int value)

public Status.Builder setCode(int value)

The status code, which should be an enum value of google.rpc.Code.

optional int32 code = 3059181;

Parameter
NameDescription
valueint

The code to set.

Returns
TypeDescription
Status.Builder

This builder for chaining.

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 = 483979842;

Parameters
NameDescription
indexint
valueAny
Returns
TypeDescription
Status.Builder

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 = 483979842;

Parameters
NameDescription
indexint
builderForValueBuilder
Returns
TypeDescription
Status.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public Status.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Status.Builder
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.

optional string message = 418054151;

Parameter
NameDescription
valueString

The message to set.

Returns
TypeDescription
Status.Builder

This builder for chaining.

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.

optional string message = 418054151;

Parameter
NameDescription
valueByteString

The bytes for message to set.

Returns
TypeDescription
Status.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Status.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
Status.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final Status.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Status.Builder
Overrides