public class I18nMessage extends Object implements ChainingCast, I18nAware
global message for user, the i18n templates and parameters should be merged into a local message based on the user's language, rather than the default message. - message - default i18n message or template - i18nCode - i18n template code - i18nArgs - i18n template args
I18nAware.I18nSource| Modifier and Type | Field and Description |
|---|---|
protected Object[] |
i18nArgs |
protected String |
i18nCode |
protected String |
message |
| Constructor and Description |
|---|
I18nMessage() |
| Modifier and Type | Method and Description |
|---|---|
void |
applyLocale(Locale locale,
@NotNull I18nAware.I18nSource source)
apply the internal locale and updates the i18n state based on the provided source.
|
boolean |
equals(Object o) |
Object[] |
getI18nArgs()
the args of template
|
String |
getI18nCode()
the i18n code, also template id
|
String |
getI18nHint()
the default message or template (if no template by code)
|
String |
getMessage() |
int |
hashCode() |
static I18nMessage |
of(@NotNull I18nAware i18n) |
I18nMessage |
setI18nArgs(Object... i18nArgs) |
I18nMessage |
setI18nCode(String i18nCode) |
I18nMessage |
setMessage(String message) |
I18nMessage |
setMessageBy(I18nAware ia) |
I18nMessage |
setMessageBy(String message,
I18nAware ia) |
I18nMessage |
setMessageBy(String message,
String i18nCode) |
I18nMessage |
setMessageBy(String message,
String i18nCode,
Object... i18nArgs) |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcastgetI18nArgsIf, getI18nArgsOr, getI18nCodeIf, getI18nCodeOr, getI18nHintIf, getI18nHintOr, toI18nString, toI18nString, toI18nString, toString, toString, toStringprotected String message
protected String i18nCode
protected Object[] i18nArgs
public String getMessage()
@Contract(value="_->this") public I18nMessage setMessage(String message)
public String getI18nCode()
I18nAwaregetI18nCode in interface I18nAware@Contract(value="_->this") public I18nMessage setI18nCode(String i18nCode)
public Object[] getI18nArgs()
I18nAwaregetI18nArgs in interface I18nAware@Contract(value="_->this") public I18nMessage setI18nArgs(Object... i18nArgs)
public String getI18nHint()
I18nAwaregetI18nHint in interface I18nAware@Contract(value="_->this") public I18nMessage setMessageBy(I18nAware ia)
@Contract(value="_,_->this") public I18nMessage setMessageBy(String message, I18nAware ia)
@Contract(value="_,_->this") public I18nMessage setMessageBy(String message, String i18nCode)
@Contract(value="_,_,_->this") public I18nMessage setMessageBy(String message, String i18nCode, Object... i18nArgs)
public void applyLocale(Locale locale, @NotNull @NotNull I18nAware.I18nSource source)
I18nAwareapplyLocale in interface I18nAwarelocale - the locale to be appliedsource - the i18n source providing the translationspublic static I18nMessage of(@NotNull @NotNull I18nAware i18n)
Copyright © 2025. All rights reserved.