Package de.aristaflow.adept2.util.i18n
Class ResBundleMessages
- java.lang.Object
-
- de.aristaflow.adept2.util.i18n.ResBundleMessages
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(String key)
Gets whether thisMessages
contains the designated key.Locale
getActualLocale()
Gets the actual locale of this messages.String
getFormattedString(String key, Object... args)
Gets the string for the designated key formatted usingFormat.format(Object)
.Locale
getLocale()
Gets the intended locale of the messages which is also used forMessageFormat
.String
getString(String key, Object... args)
Gets the string for the designated key formatted usingString.format(String, Object...)
.Iterator<String>
iterator()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface de.aristaflow.adept2.util.i18n.Messages
subMessages
-
-
-
-
Method Detail
-
getLocale
public Locale getLocale()
Description copied from interface:Messages
Gets the intended locale of the messages which is also used forMessageFormat
.
-
getActualLocale
public Locale getActualLocale()
Description copied from interface:Messages
Gets the actual locale of this messages. This may be a fallback of the intended locale.- Specified by:
getActualLocale
in interfaceMessages
- Returns:
- The actual locale of the messages .
-
containsKey
public boolean containsKey(String key)
Description copied from interface:Messages
Gets whether thisMessages
contains the designated key.- Specified by:
containsKey
in interfaceMessages
- Parameters:
key
- The key to check whether it exists in thisMessages
.- Returns:
- Whether this
Messages
contains the designated key.
-
getString
public String getString(String key, Object... args)
Description copied from interface:Messages
Gets the string for the designated key formatted usingString.format(String, Object...)
. If the key is not known, the key itself will be returned instead of throwing aMissingResoucreException
.- Specified by:
getString
in interfaceMessages
- Parameters:
key
- The key of the localised string.args
- The arguments forString.format(String, Object...)
. If this isnull
or an empty array, formatting will be skipped.- Returns:
- The formatted string message for the designated key.
-
getFormattedString
public String getFormattedString(String key, Object... args)
Description copied from interface:Messages
Gets the string for the designated key formatted usingFormat.format(Object)
. If the key is not known, the key itself will be returned instead of throwing aMissingResoucreException
.- Specified by:
getFormattedString
in interfaceMessages
- Parameters:
key
- The key of the localised string.args
- The arguments forFormat.format(Object)
.- Returns:
- The formatted string message for the designated key.
-
-