Class LocalizedMessage.Builder (1.26.0)

public static final class LocalizedMessage.Builder extends GeneratedMessageV3.Builder<LocalizedMessage.Builder> implements LocalizedMessageOrBuilder

Provides a localized error message that is safe to return to the user which can be attached to an RPC error.

Protobuf type google.cloud.compute.v1.LocalizedMessage

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public LocalizedMessage build()
Returns
TypeDescription
LocalizedMessage

buildPartial()

public LocalizedMessage buildPartial()
Returns
TypeDescription
LocalizedMessage

clear()

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

clearField(Descriptors.FieldDescriptor field)

public LocalizedMessage.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
LocalizedMessage.Builder
Overrides

clearLocale()

public LocalizedMessage.Builder clearLocale()

The locale used following the specification defined at https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Examples are: "en-US", "fr-CH", "es-MX"

optional string locale = 513150554;

Returns
TypeDescription
LocalizedMessage.Builder

This builder for chaining.

clearMessage()

public LocalizedMessage.Builder clearMessage()

The localized error message in the above locale.

optional string message = 418054151;

Returns
TypeDescription
LocalizedMessage.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clone()

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

getDefaultInstanceForType()

public LocalizedMessage getDefaultInstanceForType()
Returns
TypeDescription
LocalizedMessage

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getLocale()

public String getLocale()

The locale used following the specification defined at https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Examples are: "en-US", "fr-CH", "es-MX"

optional string locale = 513150554;

Returns
TypeDescription
String

The locale.

getLocaleBytes()

public ByteString getLocaleBytes()

The locale used following the specification defined at https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Examples are: "en-US", "fr-CH", "es-MX"

optional string locale = 513150554;

Returns
TypeDescription
ByteString

The bytes for locale.

getMessage()

public String getMessage()

The localized error message in the above locale.

optional string message = 418054151;

Returns
TypeDescription
String

The message.

getMessageBytes()

public ByteString getMessageBytes()

The localized error message in the above locale.

optional string message = 418054151;

Returns
TypeDescription
ByteString

The bytes for message.

hasLocale()

public boolean hasLocale()

The locale used following the specification defined at https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Examples are: "en-US", "fr-CH", "es-MX"

optional string locale = 513150554;

Returns
TypeDescription
boolean

Whether the locale field is set.

hasMessage()

public boolean hasMessage()

The localized error message in the above locale.

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(LocalizedMessage other)

public LocalizedMessage.Builder mergeFrom(LocalizedMessage other)
Parameter
NameDescription
otherLocalizedMessage
Returns
TypeDescription
LocalizedMessage.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

public final LocalizedMessage.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
LocalizedMessage.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

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

setLocale(String value)

public LocalizedMessage.Builder setLocale(String value)

The locale used following the specification defined at https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Examples are: "en-US", "fr-CH", "es-MX"

optional string locale = 513150554;

Parameter
NameDescription
valueString

The locale to set.

Returns
TypeDescription
LocalizedMessage.Builder

This builder for chaining.

setLocaleBytes(ByteString value)

public LocalizedMessage.Builder setLocaleBytes(ByteString value)

The locale used following the specification defined at https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Examples are: "en-US", "fr-CH", "es-MX"

optional string locale = 513150554;

Parameter
NameDescription
valueByteString

The bytes for locale to set.

Returns
TypeDescription
LocalizedMessage.Builder

This builder for chaining.

setMessage(String value)

public LocalizedMessage.Builder setMessage(String value)

The localized error message in the above locale.

optional string message = 418054151;

Parameter
NameDescription
valueString

The message to set.

Returns
TypeDescription
LocalizedMessage.Builder

This builder for chaining.

setMessageBytes(ByteString value)

public LocalizedMessage.Builder setMessageBytes(ByteString value)

The localized error message in the above locale.

optional string message = 418054151;

Parameter
NameDescription
valueByteString

The bytes for message to set.

Returns
TypeDescription
LocalizedMessage.Builder

This builder for chaining.

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

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

setUnknownFields(UnknownFieldSet unknownFields)

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