Class BadRequest.FieldViolation.Builder (2.50.1)

public static final class BadRequest.FieldViolation.Builder extends GeneratedMessageV3.Builder<BadRequest.FieldViolation.Builder> implements BadRequest.FieldViolationOrBuilder

A message type used to describe a single bad request field.

Protobuf type google.rpc.BadRequest.FieldViolation

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public BadRequest.FieldViolation.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
BadRequest.FieldViolation.Builder
Overrides

build()

public BadRequest.FieldViolation build()
Returns
Type Description
BadRequest.FieldViolation

buildPartial()

public BadRequest.FieldViolation buildPartial()
Returns
Type Description
BadRequest.FieldViolation

clear()

public BadRequest.FieldViolation.Builder clear()
Returns
Type Description
BadRequest.FieldViolation.Builder
Overrides

clearDescription()

public BadRequest.FieldViolation.Builder clearDescription()

A description of why the request element is bad.

string description = 2;

Returns
Type Description
BadRequest.FieldViolation.Builder

This builder for chaining.

clearField()

public BadRequest.FieldViolation.Builder clearField()

A path that leads to a field in the request body. The value will be a sequence of dot-separated identifiers that identify a protocol buffer field.

Consider the following:

 message CreateContactRequest {
   message EmailAddress {
     enum Type {
       TYPE_UNSPECIFIED = 0;
       HOME = 1;
       WORK = 2;
     }

     optional string email = 1;
     repeated EmailType type = 2;
   }

   string full_name = 1;
   repeated EmailAddress email_addresses = 2;
 }

In this example, in proto field could take one of the following values:

  • full_name for a violation in the full_name value
  • email_addresses[1].email for a violation in the email field of the first email_addresses message
  • email_addresses[3].type[2] for a violation in the second type value in the third email_addresses message.

    In JSON, the same values are represented as:

  • fullName for a violation in the fullName value

  • emailAddresses[1].email for a violation in the email field of the first emailAddresses message
  • emailAddresses[3].type[2] for a violation in the second type value in the third emailAddresses message.

string field = 1;

Returns
Type Description
BadRequest.FieldViolation.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public BadRequest.FieldViolation.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
BadRequest.FieldViolation.Builder
Overrides

clearLocalizedMessage()

public BadRequest.FieldViolation.Builder clearLocalizedMessage()

Provides a localized error message for field-level errors that is safe to return to the API consumer.

.google.rpc.LocalizedMessage localized_message = 4;

Returns
Type Description
BadRequest.FieldViolation.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public BadRequest.FieldViolation.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
BadRequest.FieldViolation.Builder
Overrides

clearReason()

public BadRequest.FieldViolation.Builder clearReason()

The reason of the field-level error. This is a constant value that identifies the proximate cause of the field-level error. It should uniquely identify the type of the FieldViolation within the scope of the google.rpc.ErrorInfo.domain. This should be at most 63 characters and match a regular expression of A-Z+[A-Z0-9], which represents UPPER_SNAKE_CASE.

string reason = 3;

Returns
Type Description
BadRequest.FieldViolation.Builder

This builder for chaining.

clone()

public BadRequest.FieldViolation.Builder clone()
Returns
Type Description
BadRequest.FieldViolation.Builder
Overrides

getDefaultInstanceForType()

public BadRequest.FieldViolation getDefaultInstanceForType()
Returns
Type Description
BadRequest.FieldViolation

getDescription()

public String getDescription()

A description of why the request element is bad.

string description = 2;

Returns
Type Description
String

The description.

getDescriptionBytes()

public ByteString getDescriptionBytes()

A description of why the request element is bad.

string description = 2;

Returns
Type Description
ByteString

The bytes for description.

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getField()

public String getField()

A path that leads to a field in the request body. The value will be a sequence of dot-separated identifiers that identify a protocol buffer field.

Consider the following:

 message CreateContactRequest {
   message EmailAddress {
     enum Type {
       TYPE_UNSPECIFIED = 0;
       HOME = 1;
       WORK = 2;
     }

     optional string email = 1;
     repeated EmailType type = 2;
   }

   string full_name = 1;
   repeated EmailAddress email_addresses = 2;
 }

In this example, in proto field could take one of the following values:

  • full_name for a violation in the full_name value
  • email_addresses[1].email for a violation in the email field of the first email_addresses message
  • email_addresses[3].type[2] for a violation in the second type value in the third email_addresses message.

    In JSON, the same values are represented as:

  • fullName for a violation in the fullName value

  • emailAddresses[1].email for a violation in the email field of the first emailAddresses message
  • emailAddresses[3].type[2] for a violation in the second type value in the third emailAddresses message.

string field = 1;

Returns
Type Description
String

The field.

getFieldBytes()

public ByteString getFieldBytes()

A path that leads to a field in the request body. The value will be a sequence of dot-separated identifiers that identify a protocol buffer field.

Consider the following:

 message CreateContactRequest {
   message EmailAddress {
     enum Type {
       TYPE_UNSPECIFIED = 0;
       HOME = 1;
       WORK = 2;
     }

     optional string email = 1;
     repeated EmailType type = 2;
   }

   string full_name = 1;
   repeated EmailAddress email_addresses = 2;
 }

In this example, in proto field could take one of the following values:

  • full_name for a violation in the full_name value
  • email_addresses[1].email for a violation in the email field of the first email_addresses message
  • email_addresses[3].type[2] for a violation in the second type value in the third email_addresses message.

    In JSON, the same values are represented as:

  • fullName for a violation in the fullName value

  • emailAddresses[1].email for a violation in the email field of the first emailAddresses message
  • emailAddresses[3].type[2] for a violation in the second type value in the third emailAddresses message.

string field = 1;

Returns
Type Description
ByteString

The bytes for field.

getLocalizedMessage()

public LocalizedMessage getLocalizedMessage()

Provides a localized error message for field-level errors that is safe to return to the API consumer.

.google.rpc.LocalizedMessage localized_message = 4;

Returns
Type Description
LocalizedMessage

The localizedMessage.

getLocalizedMessageBuilder()

public LocalizedMessage.Builder getLocalizedMessageBuilder()

Provides a localized error message for field-level errors that is safe to return to the API consumer.

.google.rpc.LocalizedMessage localized_message = 4;

Returns
Type Description
LocalizedMessage.Builder

getLocalizedMessageOrBuilder()

public LocalizedMessageOrBuilder getLocalizedMessageOrBuilder()

Provides a localized error message for field-level errors that is safe to return to the API consumer.

.google.rpc.LocalizedMessage localized_message = 4;

Returns
Type Description
LocalizedMessageOrBuilder

getReason()

public String getReason()

The reason of the field-level error. This is a constant value that identifies the proximate cause of the field-level error. It should uniquely identify the type of the FieldViolation within the scope of the google.rpc.ErrorInfo.domain. This should be at most 63 characters and match a regular expression of A-Z+[A-Z0-9], which represents UPPER_SNAKE_CASE.

string reason = 3;

Returns
Type Description
String

The reason.

getReasonBytes()

public ByteString getReasonBytes()

The reason of the field-level error. This is a constant value that identifies the proximate cause of the field-level error. It should uniquely identify the type of the FieldViolation within the scope of the google.rpc.ErrorInfo.domain. This should be at most 63 characters and match a regular expression of A-Z+[A-Z0-9], which represents UPPER_SNAKE_CASE.

string reason = 3;

Returns
Type Description
ByteString

The bytes for reason.

hasLocalizedMessage()

public boolean hasLocalizedMessage()

Provides a localized error message for field-level errors that is safe to return to the API consumer.

.google.rpc.LocalizedMessage localized_message = 4;

Returns
Type Description
boolean

Whether the localizedMessage field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public BadRequest.FieldViolation.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
BadRequest.FieldViolation.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public BadRequest.FieldViolation.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
BadRequest.FieldViolation.Builder
Overrides

mergeFrom(BadRequest.FieldViolation other)

public BadRequest.FieldViolation.Builder mergeFrom(BadRequest.FieldViolation other)
Parameter
Name Description
other BadRequest.FieldViolation
Returns
Type Description
BadRequest.FieldViolation.Builder

mergeLocalizedMessage(LocalizedMessage value)

public BadRequest.FieldViolation.Builder mergeLocalizedMessage(LocalizedMessage value)

Provides a localized error message for field-level errors that is safe to return to the API consumer.

.google.rpc.LocalizedMessage localized_message = 4;

Parameter
Name Description
value LocalizedMessage
Returns
Type Description
BadRequest.FieldViolation.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final BadRequest.FieldViolation.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
BadRequest.FieldViolation.Builder
Overrides

setDescription(String value)

public BadRequest.FieldViolation.Builder setDescription(String value)

A description of why the request element is bad.

string description = 2;

Parameter
Name Description
value String

The description to set.

Returns
Type Description
BadRequest.FieldViolation.Builder

This builder for chaining.

setDescriptionBytes(ByteString value)

public BadRequest.FieldViolation.Builder setDescriptionBytes(ByteString value)

A description of why the request element is bad.

string description = 2;

Parameter
Name Description
value ByteString

The bytes for description to set.

Returns
Type Description
BadRequest.FieldViolation.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public BadRequest.FieldViolation.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
BadRequest.FieldViolation.Builder
Overrides

setField(String value)

public BadRequest.FieldViolation.Builder setField(String value)

A path that leads to a field in the request body. The value will be a sequence of dot-separated identifiers that identify a protocol buffer field.

Consider the following:

 message CreateContactRequest {
   message EmailAddress {
     enum Type {
       TYPE_UNSPECIFIED = 0;
       HOME = 1;
       WORK = 2;
     }

     optional string email = 1;
     repeated EmailType type = 2;
   }

   string full_name = 1;
   repeated EmailAddress email_addresses = 2;
 }

In this example, in proto field could take one of the following values:

  • full_name for a violation in the full_name value
  • email_addresses[1].email for a violation in the email field of the first email_addresses message
  • email_addresses[3].type[2] for a violation in the second type value in the third email_addresses message.

    In JSON, the same values are represented as:

  • fullName for a violation in the fullName value

  • emailAddresses[1].email for a violation in the email field of the first emailAddresses message
  • emailAddresses[3].type[2] for a violation in the second type value in the third emailAddresses message.

string field = 1;

Parameter
Name Description
value String

The field to set.

Returns
Type Description
BadRequest.FieldViolation.Builder

This builder for chaining.

setFieldBytes(ByteString value)

public BadRequest.FieldViolation.Builder setFieldBytes(ByteString value)

A path that leads to a field in the request body. The value will be a sequence of dot-separated identifiers that identify a protocol buffer field.

Consider the following:

 message CreateContactRequest {
   message EmailAddress {
     enum Type {
       TYPE_UNSPECIFIED = 0;
       HOME = 1;
       WORK = 2;
     }

     optional string email = 1;
     repeated EmailType type = 2;
   }

   string full_name = 1;
   repeated EmailAddress email_addresses = 2;
 }

In this example, in proto field could take one of the following values:

  • full_name for a violation in the full_name value
  • email_addresses[1].email for a violation in the email field of the first email_addresses message
  • email_addresses[3].type[2] for a violation in the second type value in the third email_addresses message.

    In JSON, the same values are represented as:

  • fullName for a violation in the fullName value

  • emailAddresses[1].email for a violation in the email field of the first emailAddresses message
  • emailAddresses[3].type[2] for a violation in the second type value in the third emailAddresses message.

string field = 1;

Parameter
Name Description
value ByteString

The bytes for field to set.

Returns
Type Description
BadRequest.FieldViolation.Builder

This builder for chaining.

setLocalizedMessage(LocalizedMessage value)

public BadRequest.FieldViolation.Builder setLocalizedMessage(LocalizedMessage value)

Provides a localized error message for field-level errors that is safe to return to the API consumer.

.google.rpc.LocalizedMessage localized_message = 4;

Parameter
Name Description
value LocalizedMessage
Returns
Type Description
BadRequest.FieldViolation.Builder

setLocalizedMessage(LocalizedMessage.Builder builderForValue)

public BadRequest.FieldViolation.Builder setLocalizedMessage(LocalizedMessage.Builder builderForValue)

Provides a localized error message for field-level errors that is safe to return to the API consumer.

.google.rpc.LocalizedMessage localized_message = 4;

Parameter
Name Description
builderForValue LocalizedMessage.Builder
Returns
Type Description
BadRequest.FieldViolation.Builder

setReason(String value)

public BadRequest.FieldViolation.Builder setReason(String value)

The reason of the field-level error. This is a constant value that identifies the proximate cause of the field-level error. It should uniquely identify the type of the FieldViolation within the scope of the google.rpc.ErrorInfo.domain. This should be at most 63 characters and match a regular expression of A-Z+[A-Z0-9], which represents UPPER_SNAKE_CASE.

string reason = 3;

Parameter
Name Description
value String

The reason to set.

Returns
Type Description
BadRequest.FieldViolation.Builder

This builder for chaining.

setReasonBytes(ByteString value)

public BadRequest.FieldViolation.Builder setReasonBytes(ByteString value)

The reason of the field-level error. This is a constant value that identifies the proximate cause of the field-level error. It should uniquely identify the type of the FieldViolation within the scope of the google.rpc.ErrorInfo.domain. This should be at most 63 characters and match a regular expression of A-Z+[A-Z0-9], which represents UPPER_SNAKE_CASE.

string reason = 3;

Parameter
Name Description
value ByteString

The bytes for reason to set.

Returns
Type Description
BadRequest.FieldViolation.Builder

This builder for chaining.

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

public BadRequest.FieldViolation.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
BadRequest.FieldViolation.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final BadRequest.FieldViolation.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
BadRequest.FieldViolation.Builder
Overrides