R - the type of the object registered by this keypublic class MultitonKey<R> extends ClassKey<R> implements KeyMessages
| Modifier and Type | Field and Description |
|---|---|
private String |
key
The key formatted into a string.
|
private List<Object> |
keyPartList
List of keys that are part of the main key.
|
private static JRLogger |
LOGGER
The class logger.
|
KEY_GENERATOR_FAILURE, METHOD_KEY_GENERATOR_FAILURE, METHOD_KEY_TOSTRING_FAILURE, METHOD_NOT_FOUND, NO_KEY_GENERATOR_METHOD, NO_TOSTRING_KEY_METHOD, NULL_METHOD_KEY, NULL_METHOD_KEY_STRING| Constructor and Description |
|---|
MultitonKey(Class<R> classField,
Object... keyPart)
Default Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
private String |
buildObjectKey(Object object)
Generate the string key for an object.
|
private String |
convertMethodKeyObject(KeyGenerator methodGenerator,
Object keyValue)
Convert the key returned by an annotated method to a string (using annotation value or not).
|
boolean |
equals(Object object) |
private String |
generateAggregatedKey(Object object)
Generate unique key by using the method-level annotations.
|
private String |
generateTypeKey(Object object,
KeyGenerator typeGenerator)
Generate Type key by using the class-level annotation.
|
String |
getKey()
Return the unique key.
|
Object |
getValue()
Return the unique object if any or null.
|
int |
hashCode() |
private void |
rebuildKey()
(Re)-Build the string key by reading the keys list content.
|
String |
toString() |
getClassFieldprivate static final JRLogger LOGGER
private String key
private void rebuildKey()
private String buildObjectKey(Object object)
object - the object which is part of the global keyprivate String generateTypeKey(Object object, KeyGenerator typeGenerator)
object - the source objecttypeGenerator - the annotation that expressed how generate the string unique keyprivate String generateAggregatedKey(Object object)
object - the source objectprivate String convertMethodKeyObject(KeyGenerator methodGenerator, Object keyValue)
methodGenerator - the method annotationkeyValue - the returned key valuepublic String getKey()
Copyright © 2011–2014 JRebirth OSS. All rights reserved.