abstract fun <T : Named> named(type: Class<T>, name: String): T
Creates a simple immutable Named object of the given type and name.
The given type can be an interface that extends Named or an abstract class that 'implements' Named. An abstract class, if provided:
Named#getName()
and should define this method as abstract. Any implementation will be overridden.An interface, if provided, must not define or inherit any other methods.
Objects created using this method are not decorated or extensible.
ObjectInstantiationException
- On failure to create the new instance.
Since
4.0