public final class ResourceBundleExtensions
extends java.lang.Object
ResourceBundleExtensions holds extension methods for the class
ResourceBundle.| Constructor and Description |
|---|
ResourceBundleExtensions() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
format(java.lang.String value,
java.lang.Object... parameters)
Formats the given value with the given parameters.
|
static java.lang.String |
getString(BundleKey bundleKey)
Resolves the
String object from the given BundleKey. |
static java.lang.String |
getString(java.util.ResourceBundle resourceBundle,
java.lang.String key,
java.lang.Object... parameters)
Gets the string from the given
ResourceBundle object. |
static java.lang.String |
getString(java.util.ResourceBundle resourceBundle,
java.lang.String key,
java.lang.String defaultValue)
Gets the string from the given
ResourceBundle object. |
static java.lang.String |
getString(@NonNull java.util.ResourceBundle resourceBundle,
@NonNull java.lang.String key,
java.lang.String defaultValue,
java.lang.Object... parameters)
Gets the string from the given
ResourceBundle object. |
static java.lang.String |
getString(java.lang.String baseName,
java.util.Locale locale,
java.lang.String key)
Resolves from the given base name and locale the
ResourceBundle and get the
String from the given key and parameters. |
static java.lang.String |
getString(java.lang.String baseName,
java.util.Locale locale,
java.lang.String key,
java.lang.Object... parameters)
Resolves from the given base name and locale the
ResourceBundle and get the
String from the given key and parameters. |
static java.lang.String |
getString(java.lang.String baseName,
java.util.Locale locale,
java.lang.String key,
java.lang.String defaultValue)
Resolves from the given base name and locale the
ResourceBundle and get the
String from the given key and parameters. |
static java.lang.String |
getString(java.lang.String baseName,
@NonNull java.util.Locale locale,
java.lang.String key,
java.lang.String defaultValue,
java.lang.Object... parameters)
Resolves from the given base name and locale the
ResourceBundle and get the
String from the given key and parameters. |
static java.lang.String |
getStringQuietly(java.util.ResourceBundle resourceBundle,
java.lang.String key,
java.lang.Object... parameters)
Gets the string from the given
ResourceBundle object. |
static java.lang.String |
getStringQuietly(java.util.ResourceBundle resourceBundle,
java.lang.String key,
java.lang.String defaultValue)
Gets the string from the given
ResourceBundle object. |
static java.lang.String |
getStringQuietly(@NonNull java.util.ResourceBundle resourceBundle,
java.lang.String key,
java.lang.String defaultValue,
java.lang.Object... parameters)
Gets the string from the given
ResourceBundle object. |
static java.lang.String |
getStringQuietly(java.lang.String baseName,
@NonNull java.util.Locale locale,
java.lang.String key,
java.lang.String defaultValue,
java.lang.Object... parameters)
Resolves from the given base name and locale the
ResourceBundle and get the
String from the given key and parameters. |
public static java.lang.String getString(java.util.ResourceBundle resourceBundle,
java.lang.String key,
java.lang.Object... parameters)
throws java.util.MissingResourceException
ResourceBundle object.resourceBundle - the resource bundle to get the String object.key - the properties keyparameters - the parametersString value from the given keyjava.util.MissingResourceException - is thrown if the given key is missingpublic static java.lang.String getStringQuietly(java.util.ResourceBundle resourceBundle,
java.lang.String key,
java.lang.Object... parameters)
ResourceBundle object.resourceBundle - the resource bundle to get the String object.key - the properties keyparameters - the parametersString value from the given keypublic static java.lang.String getString(java.util.ResourceBundle resourceBundle,
java.lang.String key,
java.lang.String defaultValue)
throws java.util.MissingResourceException
ResourceBundle object.resourceBundle - the resource bundle to get the String object.key - the properties keydefaultValue - the default valueString value from the given keyjava.util.MissingResourceException - is thrown if the given key is missingpublic static java.lang.String getStringQuietly(java.util.ResourceBundle resourceBundle,
java.lang.String key,
java.lang.String defaultValue)
ResourceBundle object.resourceBundle - the resource bundle to get the String object.key - the properties keydefaultValue - the default valueString value from the given keypublic static java.lang.String getString(@NonNull
@NonNull java.util.ResourceBundle resourceBundle,
@NonNull
@NonNull java.lang.String key,
java.lang.String defaultValue,
java.lang.Object... parameters)
throws java.util.MissingResourceException
ResourceBundle object.resourceBundle - the resource bundle to get the String object.key - the properties keydefaultValue - the default valueparameters - the parametersString value from the given keyjava.util.MissingResourceException - is thrown if the given key is missingpublic static java.lang.String format(java.lang.String value,
java.lang.Object... parameters)
value - the value with the patternparameters - the parametersMessageFormat.format(String, Object...)public static java.lang.String getStringQuietly(@NonNull
@NonNull java.util.ResourceBundle resourceBundle,
java.lang.String key,
java.lang.String defaultValue,
java.lang.Object... parameters)
ResourceBundle object.resourceBundle - the resource bundle to get the String object.key - the properties keydefaultValue - the default valueparameters - the parametersString value from the given keypublic static java.lang.String getString(java.lang.String baseName,
@NonNull
@NonNull java.util.Locale locale,
java.lang.String key,
java.lang.String defaultValue,
java.lang.Object... parameters)
throws java.util.MissingResourceException
ResourceBundle and get the
String from the given key and parameters.baseName - the base name of the resource bundle, a fully qualified class namelocale - the locale for the resource bundlekey - the properties keydefaultValue - the default valueparameters - the parametersString value from the given keyjava.util.MissingResourceException - is thrown if the given key is missingpublic static java.lang.String getStringQuietly(java.lang.String baseName,
@NonNull
@NonNull java.util.Locale locale,
java.lang.String key,
java.lang.String defaultValue,
java.lang.Object... parameters)
ResourceBundle and get the
String from the given key and parameters.baseName - the base name of the resource bundle, a fully qualified class namelocale - the locale for the resource bundlekey - the properties keydefaultValue - the default valueparameters - the parametersString value from the given keypublic static java.lang.String getString(java.lang.String baseName,
java.util.Locale locale,
java.lang.String key,
java.lang.Object... parameters)
throws java.util.MissingResourceException
ResourceBundle and get the
String from the given key and parameters.baseName - the base name of the resource bundle, a fully qualified class namelocale - the locale for the resource bundlekey - the properties keyparameters - the parametersString value from the given keyjava.util.MissingResourceException - is thrown if the given key is missingpublic static java.lang.String getString(java.lang.String baseName,
java.util.Locale locale,
java.lang.String key)
throws java.util.MissingResourceException
ResourceBundle and get the
String from the given key and parameters.baseName - the base name of the resource bundle, a fully qualified class namelocale - the locale for the resource bundlekey - the properties keyString value from the given keyjava.util.MissingResourceException - is thrown if the given key is missingpublic static java.lang.String getString(java.lang.String baseName,
java.util.Locale locale,
java.lang.String key,
java.lang.String defaultValue)
throws java.util.MissingResourceException
ResourceBundle and get the
String from the given key and parameters.baseName - the base name of the resource bundle, a fully qualified class namelocale - the locale for the resource bundlekey - the properties keydefaultValue - the default valueString value from the given keyjava.util.MissingResourceException - is thrown if the given key is missingpublic static java.lang.String getString(BundleKey bundleKey) throws java.util.MissingResourceException
String object from the given BundleKey.bundleKey - the bundle keyString value from the given BundleKey.java.util.MissingResourceException - is thrown if the given key is missing