org.apache.cayenne.di
Class Key<T>
java.lang.Object
org.apache.cayenne.di.Key<T>
public class Key<T>
- extends Object
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
type
protected Class<T> type
typeName
protected String typeName
bindingName
protected String bindingName
Key
protected Key(Class<T> type,
String bindingName)
get
public static <T> Key<T> get(Class<T> type)
- Creates a key for a nameless binding of a given type.
get
public static <T> Key<T> get(Class<T> type,
String bindingName)
- 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.
getType
public Class<T> getType()
getBindingName
public String getBindingName()
- Returns an optional name of the binding used to distinguish multiple bindings of
the same object type.
equals
public boolean equals(Object object)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2001-2010 Apache Cayenne. All Rights Reserved.