public class Utils extends Object
Modifier and Type | Method and Description |
---|---|
static Injector |
createInjector()
Creates an injector instance.
|
static String |
getArgClasses(Object[] args)
Returns a comma separated simple class names of given arguments.
|
static String |
getLocalizedString(Locale locale,
String key,
Object... args)
Returns localized string for given key and locale, replacing numbered tokens ({0}, {1}...) with the arguments.
|
static <T> T |
nullSafe(T value,
T defaultValue)
Provides a null-safe way to access a value.
|
static List<RecordHolder> |
unwrapVariants(Collection<Variant.RecordVariant> variants)
Unwraps the record variants in the given collection to a list of record holders.
|
public static Injector createInjector()
Injector.SYSTEM_PROPERTY_NAME
is set, given class is instantiated, otherwise an instance of EjbRefInjector
is returned.public static String getLocalizedString(Locale locale, String key, Object... args)
locale
- key
- message keyargs
- argumentspublic static String getArgClasses(Object[] args)
args
- public static <T> T nullSafe(T value, T defaultValue)
T
- value
- optionaldefaultValue
- requirednull
public static List<RecordHolder> unwrapVariants(Collection<Variant.RecordVariant> variants)
variants
- the variants to unwrapCopyright © 2007-2018 Whitestein Technologies. All Rights Reserved.