Package com.google.rpc
Class ErrorInfo.Builder
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite.Builder
-
- com.google.protobuf.AbstractMessage.Builder<BuilderType>
-
- com.google.protobuf.GeneratedMessageV3.Builder<ErrorInfo.Builder>
-
- com.google.rpc.ErrorInfo.Builder
-
- All Implemented Interfaces:
com.google.protobuf.Message.Builder
,com.google.protobuf.MessageLite.Builder
,com.google.protobuf.MessageLiteOrBuilder
,com.google.protobuf.MessageOrBuilder
,ErrorInfoOrBuilder
,Cloneable
- Enclosing class:
- ErrorInfo
public static final class ErrorInfo.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<ErrorInfo.Builder> implements ErrorInfoOrBuilder
Describes the cause of the error with structured details. Example of an error when contacting the "pubsub.googleapis.com" API when it is not enabled: { "reason": "API_DISABLED" "domain": "googleapis.com" "metadata": { "resource": "projects/123", "service": "pubsub.googleapis.com" } } This response indicates that the pubsub.googleapis.com API is not enabled. Example of an error that is returned when attempting to create a Spanner instance in a region that is out of stock: { "reason": "STOCKOUT" "domain": "spanner.googleapis.com", "metadata": { "availableRegions": "us-central1,us-east2" } }
Protobuf typegoogle.rpc.ErrorInfo
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ErrorInfo.Builder
addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
ErrorInfo
build()
ErrorInfo
buildPartial()
ErrorInfo.Builder
clear()
ErrorInfo.Builder
clearDomain()
The logical grouping to which the "reason" belongs.ErrorInfo.Builder
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
ErrorInfo.Builder
clearMetadata()
ErrorInfo.Builder
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
ErrorInfo.Builder
clearReason()
The reason of the error.ErrorInfo.Builder
clone()
boolean
containsMetadata(String key)
Additional structured details about this error.ErrorInfo
getDefaultInstanceForType()
static com.google.protobuf.Descriptors.Descriptor
getDescriptor()
com.google.protobuf.Descriptors.Descriptor
getDescriptorForType()
String
getDomain()
The logical grouping to which the "reason" belongs.com.google.protobuf.ByteString
getDomainBytes()
The logical grouping to which the "reason" belongs.Map<String,String>
getMetadata()
Deprecated.int
getMetadataCount()
Additional structured details about this error.Map<String,String>
getMetadataMap()
Additional structured details about this error.String
getMetadataOrDefault(String key, String defaultValue)
Additional structured details about this error.String
getMetadataOrThrow(String key)
Additional structured details about this error.Map<String,String>
getMutableMetadata()
Deprecated.String
getReason()
The reason of the error.com.google.protobuf.ByteString
getReasonBytes()
The reason of the error.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()
protected com.google.protobuf.MapField
internalGetMapField(int number)
protected com.google.protobuf.MapField
internalGetMutableMapField(int number)
boolean
isInitialized()
ErrorInfo.Builder
mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
ErrorInfo.Builder
mergeFrom(com.google.protobuf.Message other)
ErrorInfo.Builder
mergeFrom(ErrorInfo other)
ErrorInfo.Builder
mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
ErrorInfo.Builder
putAllMetadata(Map<String,String> values)
Additional structured details about this error.ErrorInfo.Builder
putMetadata(String key, String value)
Additional structured details about this error.ErrorInfo.Builder
removeMetadata(String key)
Additional structured details about this error.ErrorInfo.Builder
setDomain(String value)
The logical grouping to which the "reason" belongs.ErrorInfo.Builder
setDomainBytes(com.google.protobuf.ByteString value)
The logical grouping to which the "reason" belongs.ErrorInfo.Builder
setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
ErrorInfo.Builder
setReason(String value)
The reason of the error.ErrorInfo.Builder
setReasonBytes(com.google.protobuf.ByteString value)
The reason of the error.ErrorInfo.Builder
setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
ErrorInfo.Builder
setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
-
Methods inherited from class com.google.protobuf.GeneratedMessageV3.Builder
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3
-
Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
-
Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
-
internalGetMapField
protected com.google.protobuf.MapField internalGetMapField(int number)
- Overrides:
internalGetMapField
in classcom.google.protobuf.GeneratedMessageV3.Builder<ErrorInfo.Builder>
-
internalGetMutableMapField
protected com.google.protobuf.MapField internalGetMutableMapField(int number)
- Overrides:
internalGetMutableMapField
in classcom.google.protobuf.GeneratedMessageV3.Builder<ErrorInfo.Builder>
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
- Specified by:
internalGetFieldAccessorTable
in classcom.google.protobuf.GeneratedMessageV3.Builder<ErrorInfo.Builder>
-
clear
public ErrorInfo.Builder clear()
- Specified by:
clear
in interfacecom.google.protobuf.Message.Builder
- Specified by:
clear
in interfacecom.google.protobuf.MessageLite.Builder
- Overrides:
clear
in classcom.google.protobuf.GeneratedMessageV3.Builder<ErrorInfo.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
- Specified by:
getDescriptorForType
in interfacecom.google.protobuf.Message.Builder
- Specified by:
getDescriptorForType
in interfacecom.google.protobuf.MessageOrBuilder
- Overrides:
getDescriptorForType
in classcom.google.protobuf.GeneratedMessageV3.Builder<ErrorInfo.Builder>
-
getDefaultInstanceForType
public ErrorInfo getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageOrBuilder
-
build
public ErrorInfo build()
- Specified by:
build
in interfacecom.google.protobuf.Message.Builder
- Specified by:
build
in interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
public ErrorInfo buildPartial()
- Specified by:
buildPartial
in interfacecom.google.protobuf.Message.Builder
- Specified by:
buildPartial
in interfacecom.google.protobuf.MessageLite.Builder
-
clone
public ErrorInfo.Builder clone()
- Specified by:
clone
in interfacecom.google.protobuf.Message.Builder
- Specified by:
clone
in interfacecom.google.protobuf.MessageLite.Builder
- Overrides:
clone
in classcom.google.protobuf.GeneratedMessageV3.Builder<ErrorInfo.Builder>
-
setField
public ErrorInfo.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
- Specified by:
setField
in interfacecom.google.protobuf.Message.Builder
- Overrides:
setField
in classcom.google.protobuf.GeneratedMessageV3.Builder<ErrorInfo.Builder>
-
clearField
public ErrorInfo.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
- Specified by:
clearField
in interfacecom.google.protobuf.Message.Builder
- Overrides:
clearField
in classcom.google.protobuf.GeneratedMessageV3.Builder<ErrorInfo.Builder>
-
clearOneof
public ErrorInfo.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
- Specified by:
clearOneof
in interfacecom.google.protobuf.Message.Builder
- Overrides:
clearOneof
in classcom.google.protobuf.GeneratedMessageV3.Builder<ErrorInfo.Builder>
-
setRepeatedField
public ErrorInfo.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
- Specified by:
setRepeatedField
in interfacecom.google.protobuf.Message.Builder
- Overrides:
setRepeatedField
in classcom.google.protobuf.GeneratedMessageV3.Builder<ErrorInfo.Builder>
-
addRepeatedField
public ErrorInfo.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
- Specified by:
addRepeatedField
in interfacecom.google.protobuf.Message.Builder
- Overrides:
addRepeatedField
in classcom.google.protobuf.GeneratedMessageV3.Builder<ErrorInfo.Builder>
-
mergeFrom
public ErrorInfo.Builder mergeFrom(com.google.protobuf.Message other)
- Specified by:
mergeFrom
in interfacecom.google.protobuf.Message.Builder
- Overrides:
mergeFrom
in classcom.google.protobuf.AbstractMessage.Builder<ErrorInfo.Builder>
-
mergeFrom
public ErrorInfo.Builder mergeFrom(ErrorInfo other)
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitialized
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Overrides:
isInitialized
in classcom.google.protobuf.GeneratedMessageV3.Builder<ErrorInfo.Builder>
-
mergeFrom
public ErrorInfo.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Specified by:
mergeFrom
in interfacecom.google.protobuf.Message.Builder
- Specified by:
mergeFrom
in interfacecom.google.protobuf.MessageLite.Builder
- Overrides:
mergeFrom
in classcom.google.protobuf.AbstractMessage.Builder<ErrorInfo.Builder>
- Throws:
IOException
-
getReason
public String getReason()
The reason of the error. This is a constant value that identifies the proximate cause of the error. Error reasons are unique within a particular domain of errors. This should be at most 63 characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents UPPER_SNAKE_CASE.
string reason = 1;
- Specified by:
getReason
in interfaceErrorInfoOrBuilder
- Returns:
- The reason.
-
getReasonBytes
public com.google.protobuf.ByteString getReasonBytes()
The reason of the error. This is a constant value that identifies the proximate cause of the error. Error reasons are unique within a particular domain of errors. This should be at most 63 characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents UPPER_SNAKE_CASE.
string reason = 1;
- Specified by:
getReasonBytes
in interfaceErrorInfoOrBuilder
- Returns:
- The bytes for reason.
-
setReason
public ErrorInfo.Builder setReason(String value)
The reason of the error. This is a constant value that identifies the proximate cause of the error. Error reasons are unique within a particular domain of errors. This should be at most 63 characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents UPPER_SNAKE_CASE.
string reason = 1;
- Parameters:
value
- The reason to set.- Returns:
- This builder for chaining.
-
clearReason
public ErrorInfo.Builder clearReason()
The reason of the error. This is a constant value that identifies the proximate cause of the error. Error reasons are unique within a particular domain of errors. This should be at most 63 characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents UPPER_SNAKE_CASE.
string reason = 1;
- Returns:
- This builder for chaining.
-
setReasonBytes
public ErrorInfo.Builder setReasonBytes(com.google.protobuf.ByteString value)
The reason of the error. This is a constant value that identifies the proximate cause of the error. Error reasons are unique within a particular domain of errors. This should be at most 63 characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents UPPER_SNAKE_CASE.
string reason = 1;
- Parameters:
value
- The bytes for reason to set.- Returns:
- This builder for chaining.
-
getDomain
public String getDomain()
The logical grouping to which the "reason" belongs. The error domain is typically the registered service name of the tool or product that generates the error. Example: "pubsub.googleapis.com". If the error is generated by some common infrastructure, the error domain must be a globally unique value that identifies the infrastructure. For Google API infrastructure, the error domain is "googleapis.com".
string domain = 2;
- Specified by:
getDomain
in interfaceErrorInfoOrBuilder
- Returns:
- The domain.
-
getDomainBytes
public com.google.protobuf.ByteString getDomainBytes()
The logical grouping to which the "reason" belongs. The error domain is typically the registered service name of the tool or product that generates the error. Example: "pubsub.googleapis.com". If the error is generated by some common infrastructure, the error domain must be a globally unique value that identifies the infrastructure. For Google API infrastructure, the error domain is "googleapis.com".
string domain = 2;
- Specified by:
getDomainBytes
in interfaceErrorInfoOrBuilder
- Returns:
- The bytes for domain.
-
setDomain
public ErrorInfo.Builder setDomain(String value)
The logical grouping to which the "reason" belongs. The error domain is typically the registered service name of the tool or product that generates the error. Example: "pubsub.googleapis.com". If the error is generated by some common infrastructure, the error domain must be a globally unique value that identifies the infrastructure. For Google API infrastructure, the error domain is "googleapis.com".
string domain = 2;
- Parameters:
value
- The domain to set.- Returns:
- This builder for chaining.
-
clearDomain
public ErrorInfo.Builder clearDomain()
The logical grouping to which the "reason" belongs. The error domain is typically the registered service name of the tool or product that generates the error. Example: "pubsub.googleapis.com". If the error is generated by some common infrastructure, the error domain must be a globally unique value that identifies the infrastructure. For Google API infrastructure, the error domain is "googleapis.com".
string domain = 2;
- Returns:
- This builder for chaining.
-
setDomainBytes
public ErrorInfo.Builder setDomainBytes(com.google.protobuf.ByteString value)
The logical grouping to which the "reason" belongs. The error domain is typically the registered service name of the tool or product that generates the error. Example: "pubsub.googleapis.com". If the error is generated by some common infrastructure, the error domain must be a globally unique value that identifies the infrastructure. For Google API infrastructure, the error domain is "googleapis.com".
string domain = 2;
- Parameters:
value
- The bytes for domain to set.- Returns:
- This builder for chaining.
-
getMetadataCount
public int getMetadataCount()
Description copied from interface:ErrorInfoOrBuilder
Additional structured details about this error. Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {"instanceLimit": "100/request"}, should be returned as, {"instanceLimitPerRequest": "100"}, if the client exceeds the number of instances that can be created in a single (batch) request.
map<string, string> metadata = 3;
- Specified by:
getMetadataCount
in interfaceErrorInfoOrBuilder
-
containsMetadata
public boolean containsMetadata(String key)
Additional structured details about this error. Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {"instanceLimit": "100/request"}, should be returned as, {"instanceLimitPerRequest": "100"}, if the client exceeds the number of instances that can be created in a single (batch) request.
map<string, string> metadata = 3;
- Specified by:
containsMetadata
in interfaceErrorInfoOrBuilder
-
getMetadata
@Deprecated public Map<String,String> getMetadata()
Deprecated.UsegetMetadataMap()
instead.- Specified by:
getMetadata
in interfaceErrorInfoOrBuilder
-
getMetadataMap
public Map<String,String> getMetadataMap()
Additional structured details about this error. Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {"instanceLimit": "100/request"}, should be returned as, {"instanceLimitPerRequest": "100"}, if the client exceeds the number of instances that can be created in a single (batch) request.
map<string, string> metadata = 3;
- Specified by:
getMetadataMap
in interfaceErrorInfoOrBuilder
-
getMetadataOrDefault
public String getMetadataOrDefault(String key, String defaultValue)
Additional structured details about this error. Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {"instanceLimit": "100/request"}, should be returned as, {"instanceLimitPerRequest": "100"}, if the client exceeds the number of instances that can be created in a single (batch) request.
map<string, string> metadata = 3;
- Specified by:
getMetadataOrDefault
in interfaceErrorInfoOrBuilder
-
getMetadataOrThrow
public String getMetadataOrThrow(String key)
Additional structured details about this error. Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {"instanceLimit": "100/request"}, should be returned as, {"instanceLimitPerRequest": "100"}, if the client exceeds the number of instances that can be created in a single (batch) request.
map<string, string> metadata = 3;
- Specified by:
getMetadataOrThrow
in interfaceErrorInfoOrBuilder
-
clearMetadata
public ErrorInfo.Builder clearMetadata()
-
removeMetadata
public ErrorInfo.Builder removeMetadata(String key)
Additional structured details about this error. Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {"instanceLimit": "100/request"}, should be returned as, {"instanceLimitPerRequest": "100"}, if the client exceeds the number of instances that can be created in a single (batch) request.
map<string, string> metadata = 3;
-
getMutableMetadata
@Deprecated public Map<String,String> getMutableMetadata()
Deprecated.Use alternate mutation accessors instead.
-
putMetadata
public ErrorInfo.Builder putMetadata(String key, String value)
Additional structured details about this error. Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {"instanceLimit": "100/request"}, should be returned as, {"instanceLimitPerRequest": "100"}, if the client exceeds the number of instances that can be created in a single (batch) request.
map<string, string> metadata = 3;
-
putAllMetadata
public ErrorInfo.Builder putAllMetadata(Map<String,String> values)
Additional structured details about this error. Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {"instanceLimit": "100/request"}, should be returned as, {"instanceLimitPerRequest": "100"}, if the client exceeds the number of instances that can be created in a single (batch) request.
map<string, string> metadata = 3;
-
setUnknownFields
public final ErrorInfo.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
setUnknownFields
in interfacecom.google.protobuf.Message.Builder
- Overrides:
setUnknownFields
in classcom.google.protobuf.GeneratedMessageV3.Builder<ErrorInfo.Builder>
-
mergeUnknownFields
public final ErrorInfo.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
mergeUnknownFields
in interfacecom.google.protobuf.Message.Builder
- Overrides:
mergeUnknownFields
in classcom.google.protobuf.GeneratedMessageV3.Builder<ErrorInfo.Builder>
-
-