APIdia Launch Partner
Top Description Methods
jdk.jpackage.internal.util

public Interface StringBundle

Annotations
@FunctionalInterface
Imports
java.text.MessageFormat, java.util.ResourceBundle

String bundle contains locale-specific strings. It can be viewed a specialized variant of ResourceBundle.

Use fromResourceBundle(ResourceBundle) to obtain StringBundle instance from ResourceBundle object.

Method Summary

Modifier and TypeMethod and Description
public default String

Returns:

the formatted message
format
(String
the key for the desired pattern
key
,
Object...
the array of arguments for formatting or an empty array for no formatting
args
)

Gets a formatted message built from the pattern string matching the given key in this string bundle and the given arguments.

public static StringBundle

Returns:

the string bundle
fromResourceBundle
(ResourceBundle
the resource bundle
bundle
)

Gets StringBundle instance from the given ResourceBundle object.

public String

Returns:

the string for the given key
getString
(String
the key for the desired string
key
)

Gets a string for the given key from this string bundle.

Method Detail

formatback to summary
public default String format(String key, Object... args)

Gets a formatted message built from the pattern string matching the given key in this string bundle and the given arguments.

If non-empty list of arguments provided the function calls MessageFormat#format(String, Object...). Otherwise, it returns the result of getString(String) method call.

Parameters
key:String

the key for the desired pattern

args:Object[]

the array of arguments for formatting or an empty array for no formatting

Returns:String

the formatted message

fromResourceBundleback to summary
public static StringBundle fromResourceBundle(ResourceBundle bundle)

Gets StringBundle instance from the given ResourceBundle object.

Parameters
bundle:ResourceBundle

the resource bundle

Returns:StringBundle

the string bundle

getStringback to summary
public String getString(String key)

Gets a string for the given key from this string bundle.

Parameters
key:String

the key for the desired string

Returns:String

the string for the given key

See Also
ResourceBundle#getString(String)