public interface CacheType<T>
CacheTypeCapture.
While the type descriptor contains implementation classes, interface consumers must not rely on the implementation types.
About types:
If no type information is provided it defaults to the Object class. The provided type information
is used inside the cache for optimizations and as well as to select appropriate default transformation
schemes for copying objects or marshalling. The correct types are not strictly enforced at all levels by the cache
for performance reasons. The cache application guarantees that only the specified types will be used.
The cache will check the type compatibility at critical points, e.g. when reconnecting to an external storage.
Generic types: An application may provide more detailed type information to the cache, which
contains also generic type parameters by providing a CacheTypeCapture where the cache can extract
the type information.
| Modifier and Type | Field and Description |
|---|---|
static String |
DESCRIPTOR_TO_STRING_PREFIX
The used prefix for the toString() output.
|
| Modifier and Type | Method and Description |
|---|---|
CacheType<T> |
getBeanRepresentation()
Return a serializable version of this type descriptor.
|
CacheType<?> |
getComponentType()
The component type in case of an array
|
Class<T> |
getType()
Class type if not an array.
|
CacheType<?>[] |
getTypeArguments()
Known type arguments, if the type is a parametrized type.
|
String |
getTypeName()
Java language compatible type name
|
boolean |
hasTypeArguments()
The type has generic type parameters and the concrete types are known.
|
boolean |
isArray()
This type is an array.
|
static final String DESCRIPTOR_TO_STRING_PREFIX
boolean hasTypeArguments()
getTypeArguments() returns the the arguments.boolean isArray()
getComponentType().isArray().getComponentType()CacheType<?> getComponentType()
CacheType<?>[] getTypeArguments()
String getTypeName()
cache2k API documentation. Copyright © 2000–2019 headissue GmbH, Munich.