Skip navigation links


oracle.iam.configservice.api
Class LocaleUtil

java.lang.Object
  extended by oracle.iam.configservice.api.LocaleUtil


public class LocaleUtil
extends java.lang.Object

Constructor Summary
LocaleUtil()
           

 

Method Summary
static java.util.Locale getLocaleFromCode(java.lang.String localeCode)
          This method can be used where we expect a Locale object and we have an locale code "-" will be used to split language and country code in the locale code
static java.lang.String getStringValue(java.lang.Object object)
          This method can be used where we expect a string and we have an attribute value as Map of MLS values.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

LocaleUtil

public LocaleUtil()

Method Detail

getStringValue

public static java.lang.String getStringValue(java.lang.Object object)
This method can be used where we expect a string and we have an attribute value as Map of MLS values. So even if in future we add or remove MLS to an attribute, our code will not change as it supports String as well as Map. The usage example : String fName = (String) user.getAttribute("First Name"); should be replaced with String fName = LocaleUtil.getStringValue( user.getAttribute("First Name"));
Parameters:
object - is attribute value
Returns:
This will always return a string value corresponding to default locale if it encounters a map else it will return the string as it is.

getLocaleFromCode

public static java.util.Locale getLocaleFromCode(java.lang.String localeCode)
This method can be used where we expect a Locale object and we have an locale code "-" will be used to split language and country code in the locale code
Parameters:
localeCode - is locale code
Returns:
This will return a locale object depend on locale code. Locale can be null if locale code is null

Skip navigation links


Copyright © 2010, Oracle and/or its affiliates. All rights reserved.