A
- the type of the strategy adapterpublic final class StrategyRegistry<A> extends Object
Modifier and Type | Method and Description |
---|---|
void |
clearCache() |
A |
get(Class type)
Searches for an adapter corresponding to the given input type.
|
Class<A> |
getAdapterType() |
A |
getByInstance(Object value)
Gets an adapter for an object.
|
Collection<Class> |
getTypes()
Returns the registered types for which adapters are available.
|
static <A> StrategyRegistry<A> |
newInstance(Class<A> adapterType,
Map<Class,A> registrations)
Creates a strategy registry for the given adapter type.
|
static <A> StrategyRegistry<A> |
newInstance(Class<A> adapterType,
Map<Class,A> registrations,
boolean allowNonMatch)
Creates a strategy registry for the given adapter type.
|
String |
toString() |
public static <A> StrategyRegistry<A> newInstance(Class<A> adapterType, Map<Class,A> registrations)
adapterType
- the type of adapter retrieved from the registryregistrations
- map of registrations (the contents of the map are copied)public static <A> StrategyRegistry<A> newInstance(Class<A> adapterType, Map<Class,A> registrations, boolean allowNonMatch)
adapterType
- the type of adapter retrieved from the registryregistrations
- map of registrations (the contents of the map are copied)allowNonMatch
- if true, then the registry supports non-matches when retrieving an adapterpublic void clearCache()
public Class<A> getAdapterType()
public A getByInstance(Object value)
value
- for which an adapter is neededIllegalArgumentException
- if no matching adapter may be found and allowNonMatch is falsepublic A get(Class type)
type
- the type to searchIllegalArgumentException
- if no matching adapter may be found and allowNonMatch is falsepublic Collection<Class> getTypes()
${project.version} - Copyright © 2003-2015 The Apache Software Foundation.