public class I18nString extends Object implements I18nAware
String can be used as i18n template (MessageFormat by default) - i18nCode - template id, default empty - i18nArgs - template arguments, default empty - i18nHint - default text or template, not in hash and equals, default empty - i18nCache - cached value for performance
MessageFormat,
Serialized FormI18nAware.I18nSource| Constructor and Description |
|---|
I18nString(String i18nCode) |
I18nString(String i18nCode,
String i18nHint) |
I18nString(String i18nCode,
String i18nHint,
Object... args) |
| 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) |
@NotNull Object[] |
getI18nArgs()
the args of template
|
@Nullable String |
getI18nCache() |
@NotNull String |
getI18nCode()
the i18n code, also template id
|
@NotNull String |
getI18nHint()
the default message or template (if no template by code)
|
int |
hashCode() |
boolean |
isEmpty() |
static I18nString |
of(@NotNull I18nAware i18n)
the string as i18nCode, empty args and hint
|
static I18nString |
of(String str)
the string as i18nCode, empty args and hint
|
I18nString |
setI18nCache(String i18nCache) |
I18nString |
setI18nHint(String i18nHint) |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetI18nArgsIf, getI18nArgsOr, getI18nCodeIf, getI18nCodeOr, getI18nHintIf, getI18nHintOr, toI18nString, toI18nString, toI18nString, toString, toString, toStringpublic I18nString(String i18nCode)
@NotNull public @NotNull String getI18nCode()
I18nAwaregetI18nCode in interface I18nAware@NotNull public @NotNull Object[] getI18nArgs()
I18nAwaregetI18nArgs in interface I18nAware@NotNull public @NotNull String getI18nHint()
I18nAwaregetI18nHint in interface I18nAware@Contract(value="_ -> this") public I18nString setI18nHint(String i18nHint)
@Nullable public @Nullable String getI18nCache()
@Contract(value="_->this") public I18nString setI18nCache(String i18nCache)
public boolean isEmpty()
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 I18nString of(String str)
public static I18nString of(@NotNull @NotNull I18nAware i18n)
Copyright © 2025. All rights reserved.