A
- the type of the strategy adapterpublic final class StrategyRegistry<A> extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
clearCache() |
A |
get(java.lang.Class type)
Searches for an adapter corresponding to the given input type.
|
java.lang.Class<A> |
getAdapterType() |
A |
getByInstance(java.lang.Object value)
Gets an adapter for an object.
|
java.util.Collection<java.lang.Class> |
getTypes()
Returns the registered types for which adapters are available.
|
static <A> StrategyRegistry<A> |
newInstance(java.lang.Class<A> adapterType,
java.util.Map<java.lang.Class,A> registrations)
Creates a strategy registry for the given adapter type.
|
static <A> StrategyRegistry<A> |
newInstance(java.lang.Class<A> adapterType,
java.util.Map<java.lang.Class,A> registrations,
boolean allowNonMatch)
Creates a strategy registry for the given adapter type.
|
java.lang.String |
toString() |
public static <A> StrategyRegistry<A> newInstance(java.lang.Class<A> adapterType, java.util.Map<java.lang.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(java.lang.Class<A> adapterType, java.util.Map<java.lang.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 java.lang.Class<A> getAdapterType()
public A getByInstance(java.lang.Object value)
value
- for which an adapter is neededjava.lang.IllegalArgumentException
- if no matching adapter may be found and allowNonMatch is falsepublic A get(java.lang.Class type)
type
- the type to searchjava.lang.IllegalArgumentException
- if no matching adapter may be found and allowNonMatch is falsepublic java.util.Collection<java.lang.Class> getTypes()
public java.lang.String toString()
toString
in class java.lang.Object
${project.version} - Copyright © 2003-2015 The Apache Software Foundation.