Package org.apache.cayenne.di
Class Key<T>
java.lang.Object
org.apache.cayenne.di.Key<T>
An object that encapsulates a key used to store and lookup DI bindings. Key is made of
a binding type and an optional binding name.
- Since:
- 3.1
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
static <T> Key
<T> Creates a key for a nameless binding of a given type.static <T> Key
<T> Creates a key for a named binding of a given type.Returns an optional name of the binding used to distinguish multiple bindings of the same object type.getType()
int
hashCode()
toString()
-
Field Details
-
typeLiteral
- Since:
- 4.0
-
bindingName
-
-
Constructor Details
-
Key
-
-
Method Details
-
get
Creates a key for a nameless binding of a given type. -
get
Creates a key for a named binding of a given type. 'bindingName' that is an empty String is treated the same way as a null 'bindingName'. In both cases a nameless binding key is created. -
getListOf
- Since:
- 4.0
-
getListOf
- Since:
- 4.0
-
getMapOf
- Since:
- 4.0
-
getMapOf
public static <K,V> Key<Map<K,V>> getMapOf(Class<K> keyType, Class<V> valueType, String bindingName) - Since:
- 4.0
-
getType
-
getBindingName
Returns an optional name of the binding used to distinguish multiple bindings of the same object type. -
equals
-
hashCode
public int hashCode() -
toString
-