T - the type of the enumpublic final class CombinedExtendedEnum<T extends Named> extends Object
Each ExtendedEnum is kept separate to ensure fast lookup of the common case.
This class uses a configuration file to determine the extended enums to combine.
It is intended that this class is used as a helper class to load the configuration and manage the map of names to instances. It should be created and used by the author of the main abstract extended enum class, and not be application developers.
| Modifier and Type | Method and Description |
|---|---|
Optional<T> |
find(String name)
Finds an instance by name.
|
T |
lookup(String name)
Looks up an instance by name.
|
static <R extends Named> |
of(Class<R> type)
Obtains a combined extended enum instance.
|
String |
toString() |
public static <R extends Named> CombinedExtendedEnum<R> of(Class<R> type)
Calling this method loads configuration files to determine which extended enums to combine. The configuration file has the same simple name as the specified type and is a INI file with the suffix '.ini'.
R - the type of the enumtype - the type to loadpublic Optional<T> find(String name)
This finds the instance matching the specified name. Instances may have alternate names (aliases), thus the returned instance may have a name other than that requested.
name - the enum name to returnpublic T lookup(String name)
This finds the instance matching the specified name. Instances may have alternate names (aliases), thus the returned instance may have a name other than that requested.
name - the enum name to returnIllegalArgumentException - if the name is not foundCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.