Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cayenne.di
Class Key<T>

    java.lang.Object
      org.apache.cayenne.di.Key<T>

    public class Key<T>

extends java.lang.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

Field Summary
`protected java.lang.String` | `bindingName`
`protected java.lang.Class<T>` | `type`
`protected java.lang.String` | `typeName`

Constructor Summary
`protected` | `Key(java.lang.Class<T> type, java.lang.String bindingName)`

Method Summary
`boolean` | `equals(java.lang.Object object)`
`static
`<T> Key<T>`
` | `get(java.lang.Class<T> type)` Creates a key for a nameless binding of a given type.
`static
`<T> Key<T>`
` | `get(java.lang.Class<T> type, java.lang.String bindingName)` Creates a key for a named binding of a given type.
`java.lang.String` | `getBindingName()` Returns an optional name of the binding used to distinguish multiple bindings of the same object type.
`java.lang.Class<T>` | `getType()`
`int` | `hashCode()`
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### type

    protected java.lang.Class<T> type

### typeName

    protected java.lang.String typeName

### bindingName

    protected java.lang.String bindingName

Constructor Detail

### Key

    protected Key(java.lang.Class<T> type,
                  java.lang.String bindingName)

Method Detail

### get

    public static <T> Key<T> get(java.lang.Class<T> type)

  Creates a key for a nameless binding of a given type.

### get

    public static <T> Key<T> get(java.lang.Class<T> type,
                                 java.lang.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 java.lang.Class<T> getType()

### getBindingName

    public java.lang.String getBindingName()

  Returns an optional name of the binding used to distinguish multiple bindings of the same object type.

### equals

    public boolean equals(java.lang.Object object)

  Overrides:
    `equals` in class `java.lang.Object`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `java.lang.Object`

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2012 Apache Cayenne. All Rights Reserved.