Package fr.gouv.vitam.common.i18n

# Class Messages

java.lang.Object
fr.gouv.vitam.common.i18n.Messages

public class Messages extends Object
Internationalization Messages support

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final Locale`
  `DEFAULT_LOCALE`
  Default Locale

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Messages(String bundleName)`
  Constructor using default Locale (FRENCH)
  `Messages(String bundleName, Locale locale)`
  Constructor

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `containsKey(String key)`
  Determines whether the given `key` is contained in this `ResourceBundle` or its parent bundles.
  `Map<String,String>`
  `getAllMessages()`
  Retrieve all the messages
  `Locale`
  `getLocale()`
  `final String`
  `getString(String key)`
  `final String`
  `getString(String key, Object... args)`
  `final String`
  `getStringNotEmpty(String key, Object... args)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### DEFAULT_LOCALE

    public static final Locale DEFAULT_LOCALE
    Default Locale

- ## Constructor Details

  - ### Messages

    public Messages(String bundleName)
    Constructor using default Locale (FRENCH)
    Parameters:
      `bundleName` - the bundle name

  - ### Messages

    public Messages(String bundleName, Locale locale)
    Constructor
    Parameters:
      `bundleName` - the bundle name
      `locale` - the Local object

- ## Method Details

  - ### getAllMessages

    public Map<String,String> getAllMessages()
    Retrieve all the messages
    Returns:
      map of messages

  - ### getString

    public final String getString(String key)
    Parameters:
      `key` - the key of the message
    Returns:
      the associated message

  - ### getString

    public final String getString(String key, Object... args)
    Parameters:
      `key` - the key of the message
      `args` - the arguments to use as MessageFormat.format(mesg, args)
    Returns:
      the associated message

  - ### getStringNotEmpty

    public final String getStringNotEmpty(String key, Object... args)
    Parameters:
      `key` - the key of the message
      `args` - the arguments to use as MessageFormat.format(mesg, args)
    Returns:
      the associated message, !key! if value is null or empty

  - ### getLocale

    public Locale getLocale()
    Returns:
      the current Locale

  - ### containsKey

    public boolean containsKey(String key)
    Determines whether the given `key` is contained in this `ResourceBundle` or its parent bundles.
    Parameters:
      `key` - the resource `key`
    Returns:
      `true` if the given `key` is contained in this `ResourceBundle` or its parent bundles; `false` otherwise.
    Throws:
      `NullPointerException` - if `key` is `null`