# Interface InternationalString

All Superinterfaces:
  `CharSequence, Comparable<InternationalString>`

All Known Implementing Classes:
  `AbstractInternationalString, DefaultInternationalString, ResourceInternationalString, SimpleInternationalString`

public interface InternationalString extends CharSequence, Comparable<InternationalString>
A string that has been internationalized into several locales. This interface is used as a replacement for the `String` type whenever an attribute needs to be internationalization capable.

The natural ordering is defined by the lexicographical ordering of strings in the default locale, as returned by `toString()`. This string also defines the character sequence for this object.

Since:
  2.0
See Also:
  - invalid reference

        javax​.xml​.registry​.infomodel​.InternationalString

  - `NameFactory​.createInternationalString(Map)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `toString()`
  Returns this string in the default locale.
  `String`
  `toString(Locale locale)`
  Returns this string in the given locale.

  ### Methods inherited from interface CharSequence

  `charAt, chars, codePoints, getChars, isEmpty, length, subSequence`

  ### Methods inherited from interface Comparable

  `compareTo`

- ## Method Details

  - ### toString

    String toString(Locale locale)
    Returns this string in the given locale. If no string is available in the given locale, then some default locale is used. The default locale is implementation-dependent. It may or may not be the system default.
    Parameters:
      `locale` - The desired locale for the string to be returned, or `null` for a string in the implementation default locale.
    Returns:
      The string in the given locale if available, or in the default locale otherwise.

  - ### toString

    String toString()
    Returns this string in the default locale. The default locale is implementation-dependent. It may or may not be the system default. If the default locale is the system default (a recommended practice), then invoking this method is equivalent to invoking `toString(Locale​.getDefault())`.

    All methods from `CharSequence` operate on this string. This string is also used as the criterion for natural ordering.

    Specified by:
      `toString` in interface `CharSequence`
    Overrides:
      `toString` in class `Object`
    Returns:
      The string in the default locale.