public final class LocalizableMessage
extends java.lang.Object
implements java.io.Serializable, com.vmware.vapi.bindings.StaticStructure
LocalizableMessage
class represents localizable string and message
template. Interfaces include one or more localizable message templates in the
exceptions they report so that clients can display diagnostic messages in the
native language of the user. Interfaces can include localizable strings in the
data returned from methods to allow clients to display localized status
information in the native language of the user.Modifier and Type | Class and Description |
---|---|
static class |
LocalizableMessage.Builder
Builder class for
LocalizableMessage . |
Modifier and Type | Field and Description |
---|---|
protected com.vmware.vapi.data.StructValue |
__dynamicStructureFields |
Modifier | Constructor and Description |
---|---|
|
LocalizableMessage()
Default constructor.
|
|
LocalizableMessage(java.lang.String id,
java.lang.String defaultMessage,
java.util.List<java.lang.String> args)
This constructor is provided for backwards compatibility purposes only.
|
protected |
LocalizableMessage(com.vmware.vapi.data.StructValue __dynamicStructureFields) |
Modifier and Type | Method and Description |
---|---|
<T extends com.vmware.vapi.bindings.Structure> |
_convertTo(java.lang.Class<T> clazz) |
java.lang.String |
_getCanonicalName() |
static java.lang.String |
_getCanonicalTypeName()
Returns the canonical type name.
|
static com.vmware.vapi.bindings.type.StructType |
_getClassType()
WARNING: Internal method, subject to change in future versions.
|
com.vmware.vapi.data.StructValue |
_getDataValue() |
com.vmware.vapi.data.DataValue |
_getDynamicField(java.lang.String fieldName) |
java.util.Set<java.lang.String> |
_getDynamicFieldNames() |
com.vmware.vapi.bindings.type.StructType |
_getType() |
boolean |
_hasTypeNameOf(java.lang.Class<? extends com.vmware.vapi.bindings.Structure> clazz) |
static LocalizableMessage |
_newInstance(com.vmware.vapi.data.StructValue structValue)
WARNING: Internal method, subject to change in future versions.
Returns new instance of this binding class and injects the provided data value. WARNING: The returned object is not fully initialized. |
static LocalizableMessage |
_newInstance2(com.vmware.vapi.data.StructValue structValue)
WARNING: Internal method, subject to change in future versions.
Serves as a versioning mechanism. |
void |
_setDynamicField(java.lang.String fieldName,
com.vmware.vapi.data.DataValue fieldValue) |
protected void |
_updateDataValue(com.vmware.vapi.data.StructValue structValue) |
void |
_validate() |
boolean |
equals(java.lang.Object obj) |
java.util.List<java.lang.String> |
getArgs()
Positional arguments to be substituted into the message template.
|
java.lang.String |
getDefaultMessage()
The value of this localizable string or message template in the
en_US
(English) locale. |
java.lang.String |
getId()
Unique identifier of the localizable string or message template.
|
java.lang.String |
getLocalized()
Localized string value as per request requirements.
|
java.util.Map<java.lang.String,LocalizationParam> |
getParams()
Named arguments to be substituted into the message template.
|
int |
hashCode() |
void |
setArgs(java.util.List<java.lang.String> args)
Positional arguments to be substituted into the message template.
|
void |
setDefaultMessage(java.lang.String defaultMessage)
The value of this localizable string or message template in the
en_US
(English) locale. |
void |
setId(java.lang.String id)
Unique identifier of the localizable string or message template.
|
void |
setLocalized(java.lang.String localized)
Localized string value as per request requirements.
|
void |
setParams(java.util.Map<java.lang.String,LocalizationParam> params)
Named arguments to be substituted into the message template.
|
java.lang.String |
toString() |
protected com.vmware.vapi.data.StructValue __dynamicStructureFields
public LocalizableMessage(java.lang.String id, java.lang.String defaultMessage, java.util.List<java.lang.String> args)
public LocalizableMessage()
protected LocalizableMessage(com.vmware.vapi.data.StructValue __dynamicStructureFields)
public java.lang.String getId()
This identifier is typically used to retrieve a locale-specific string or message template from a message catalog.
public void setId(java.lang.String id)
This identifier is typically used to retrieve a locale-specific string or message template from a message catalog.
id
- New value for the property.public java.lang.String getDefaultMessage()
en_US
(English) locale. If getId()
refers
to a message template, the default message will contain the substituted
arguments. This value can be used by clients that do not need to display strings
and messages in the native language of the user. It could also be used as a
fallback if a client is unable to access the appropriate message catalog.public void setDefaultMessage(java.lang.String defaultMessage)
en_US
(English) locale. If getId()
refers
to a message template, the default message will contain the substituted
arguments. This value can be used by clients that do not need to display strings
and messages in the native language of the user. It could also be used as a
fallback if a client is unable to access the appropriate message catalog.defaultMessage
- New value for the property.public java.util.List<java.lang.String> getArgs()
public void setArgs(java.util.List<java.lang.String> args)
args
- New value for the property.public java.util.Map<java.lang.String,LocalizationParam> getParams()
null
means that the message template requires no arguments or positional
arguments are used.public void setParams(java.util.Map<java.lang.String,LocalizationParam> params)
null
means that the message template requires no arguments or positional
arguments are used.params
- New value for the property.public java.lang.String getLocalized()
public void setLocalized(java.lang.String localized)
localized
- New value for the property.public com.vmware.vapi.bindings.type.StructType _getType()
_getType
in interface com.vmware.vapi.bindings.StaticStructure
public com.vmware.vapi.data.StructValue _getDataValue()
_getDataValue
in interface com.vmware.vapi.bindings.Structure
protected void _updateDataValue(com.vmware.vapi.data.StructValue structValue)
public void _validate()
_validate
in interface com.vmware.vapi.bindings.StaticStructure
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in interface com.vmware.vapi.bindings.StaticStructure
toString
in class java.lang.Object
public boolean _hasTypeNameOf(java.lang.Class<? extends com.vmware.vapi.bindings.Structure> clazz)
_hasTypeNameOf
in interface com.vmware.vapi.bindings.Structure
public <T extends com.vmware.vapi.bindings.Structure> T _convertTo(java.lang.Class<T> clazz)
_convertTo
in interface com.vmware.vapi.bindings.Structure
public void _setDynamicField(java.lang.String fieldName, com.vmware.vapi.data.DataValue fieldValue)
_setDynamicField
in interface com.vmware.vapi.bindings.StaticStructure
public com.vmware.vapi.data.DataValue _getDynamicField(java.lang.String fieldName)
_getDynamicField
in interface com.vmware.vapi.bindings.StaticStructure
public java.util.Set<java.lang.String> _getDynamicFieldNames()
_getDynamicFieldNames
in interface com.vmware.vapi.bindings.StaticStructure
public static com.vmware.vapi.bindings.type.StructType _getClassType()
StructType
instance representing the static bindings
type for this Structure
.public java.lang.String _getCanonicalName()
_getCanonicalName
in interface com.vmware.vapi.bindings.Structure
public static java.lang.String _getCanonicalTypeName()
_getCanonicalName()
.public static LocalizableMessage _newInstance(com.vmware.vapi.data.StructValue structValue)
structValue
- the source of the data contained in the binding object. Could
contain more data than fields of this class can describe i.e.
newer version of the binding object. Could be null.StructType
public static LocalizableMessage _newInstance2(com.vmware.vapi.data.StructValue structValue)