Package com.appiancorp.suiteapi.common
Class LocaleString
java.lang.Object
com.appiancorp.suiteapi.common.LocaleString
- All Implemented Interfaces:
Serializable
,Cloneable
LocaleString
LocaleString represents one String with representations in one or more Locales, or in all Locales (an insensitive String).
This may be output or input as a single encoded String, using escapes.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Clone this LocaleString; the result will have its own locale sensitive map.boolean
containsLocale
(Locale locale_) boolean
final String
final String
Get the Locale keys for this LocaleString.int
hashCode()
boolean
final void
final void
final void
final String
retrieveValueForLocaleOrFirstAvailable
(Locale targetLocale) Returns the localized value for the given locale, if available.final String
retrieveValueForUserLocaleOrPrimary
(Locale userLocale, SiteLocaleSettings sls) Deprecated.This method will be removed in a future release.final String
retrieveValueForUserLocaleOrPrimary
(Locale userLocale, Locale primaryLocale) Returns the localized value for the user's locale, if available.final String
toString()
Returns a string representation of the givenLocaleString
object.
-
Constructor Details
-
LocaleString
public LocaleString() -
LocaleString
-
LocaleString
-
-
Method Details
-
get
-
get
-
retrieveValueForUserLocaleOrPrimary
@Deprecated public final String retrieveValueForUserLocaleOrPrimary(Locale userLocale, SiteLocaleSettings sls) Deprecated.This method will be removed in a future release. Use retrieveValueForUserLocaleOrPrimary(Locale, Locale) instead.Returns the localized value for the user's locale, if available. If the value is not available in the user's locale, it falls back to the site's primary locale. -
retrieveValueForUserLocaleOrPrimary
Returns the localized value for the user's locale, if available. If the value is not available in the user's locale, it falls back to the site's primary locale. -
retrieveValueForLocaleOrFirstAvailable
Returns the localized value for the given locale, if available. If the value is not available in the given locale, returns the first available value. If there are no values at all, returnsnull
. -
put
-
put
-
put
-
toEncodedString
- Returns:
- the encoded representation of the mappings contained in this object.
-
getLocales
Get the Locale keys for this LocaleString.- Returns:
- Set of Locales stored in this LocaleString, which may be empty for LocaleStrings insensitive to Locale
- Throws:
IllegalStateException
- if an invalid Locale is encountered
-
toString
Returns a string representation of the givenLocaleString
object. The returned string representation is suitable for logging or debugging. This should NOT be used for outputting the string to the end-user. -
isExpression
public boolean isExpression()- Returns:
- if this LocaleString contains an expression as part of its locale mappings.
-
getLocalizeExpressionString
- Returns:
- the String representation of the localize expression-function used to validate LocaleString objects that contain expressions in its mappings.
-
getStringLocales
-
containsLocale
-
equals
-
hashCode
public int hashCode() -
clone
Clone this LocaleString; the result will have its own locale sensitive map.
-