public interface Named
This simple interface is used to define objects that can be identified by a unique name. The name contains enough information to be able to recreate the instance.
Implementations should provide a static method of(String) that allows the
instance to be created from the name.
| Modifier and Type | Method and Description |
|---|---|
String |
getName()
Gets the unique name of the instance.
|
static <T extends Named> |
of(Class<T> type,
String name)
Obtains an instance of the specified named type by name.
|
static <T extends Named> T of(Class<T> type, String name)
This method operates by reflection.
It requires a static method of(String) method to be present on the type specified.
If the method does not exist an exception is thrown.
T - the named typetype - the named type with the of(String) methodname - the name to findIllegalArgumentException - if the specified name could not be foundString getName()
The name contains enough information to be able to recreate the instance.
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.