T
- the type being mapped to and from strings.public class LocalizedEnumNames<T> extends Object
keyResolver
.Constructor and Description |
---|
LocalizedEnumNames(Function<String,? extends T> keyResolver,
@NonNls String unknownKey,
@Nullable @NonNls String commaSeparatedNamesKey,
@NonNls String baseName,
boolean reversedMap)
Creates an instance.
|
LocalizedEnumNames(IntFunction<? extends T> integerResolver,
@NonNls String unknownKey,
@Nullable @NonNls String commaSeparatedNamesKey,
@NonNls String baseName,
boolean reversedMap)
Creates an instance.
|
Modifier and Type | Method and Description |
---|---|
@NotNull List<String> |
getAutoCompleteSuggestions(Locale locale,
String arg)
Retrieves autocomplete suggestions that are values of type T.
|
T |
nameToValue(Locale locale,
String name)
Gets a value by its localized name.
|
String |
valueToName(Locale locale,
T value)
Gets the localized name for an instance of T.
|
public LocalizedEnumNames(IntFunction<? extends T> integerResolver, @NonNls @NonNls String unknownKey, @Nullable @NonNls @Nullable @NonNls String commaSeparatedNamesKey, @NonNls @NonNls String baseName, boolean reversedMap)
integerResolver
- used to map integers in the resource bundle to instances of TunknownKey
- a key in strings.properties that provides a name for unknown future valuescommaSeparatedNamesKey
- a key in strings.properties that provides canonical names for
auto-complete, separated by commas; or null to build one using
all values of the resource bundlebaseName
- the base name of the resource bundlereversedMap
- true if the keys and values are reversedpublic LocalizedEnumNames(Function<String,? extends T> keyResolver, @NonNls @NonNls String unknownKey, @Nullable @NonNls @Nullable @NonNls String commaSeparatedNamesKey, @NonNls @NonNls String baseName, boolean reversedMap)
keyResolver
- used to map keys in the resource bundle to instances of TunknownKey
- a key in strings.properties that provides a name for unknown future valuescommaSeparatedNamesKey
- a key in strings.properties that provides canonical names for
auto-complete, separated by commas; or null to build one using
all values of the resource bundlebaseName
- the base name of the resource bundlereversedMap
- true if the keys and values are reversed@NotNull public @NotNull List<String> getAutoCompleteSuggestions(Locale locale, String arg)
locale
- the input localearg
- the incomplete argument to finish@Nullable public T nameToValue(Locale locale, String name)
ALSO_ACCEPT_LOCALE
are accepted, and matching is case- and accent-insensitive (per Collator.PRIMARY
).locale
- the locale the user is assumed to be usingname
- the name to look upCopyright © 2021. All rights reserved.