public interface FactoryLookup
| Modifier and Type | Method and Description |
|---|---|
<T> Factory<T> |
getFactory(Type type)
Get the Factory registered for the specified class.
|
default <T> Factory<T> |
getFactoryIfAvailable(Type type,
Supplier<Factory<T>> fallback) |
static FactoryLookup |
getInstance() |
static ServiceDefinition<FactoryLookup> |
getServiceDefinition() |
boolean |
hasFactory(Type type)
Does this contain a Factory registered against the specified class?
|
<T> Factory<T> getFactory(Type type) throws IllegalArgumentException, NoSuchFactoryException
Get the Factory registered for the specified class.
To check whether a Factory is registered for a specified class, please refer to
hasFactory(Class<?> clazz);.
type - The type the Factory is registered against. This should be the type of object that the Factory
creates.IllegalArgumentException - If the class is deemed illegal.NoSuchFactoryException - If this does not contain a Factory registered against the specified class.boolean hasFactory(Type type) throws IllegalArgumentException
type - The type a Factory could be registered against. This should be the type of object that the Factory
creates.true if the collection contains a Factory registered for the specified class;
false otherwise.IllegalArgumentException - If the clazz is deemed illegal.default <T> Factory<T> getFactoryIfAvailable(Type type, Supplier<Factory<T>> fallback)
static ServiceDefinition<FactoryLookup> getServiceDefinition()
static FactoryLookup getInstance()
Copyright © 2010–2020 meanbean. All rights reserved.