Interface CacheType<T>

  • All Known Implementing Classes:
    CacheTypeCapture, CacheTypeCapture.OfArray, CacheTypeCapture.OfClass, CacheTypeCapture.OfGeneric

    public interface CacheType<T>
    A data structure to retain all known type information from the key and value types, including generic parameters within the cache configuration. A caching application typically constructs a type descriptor with the use of a CacheTypeCapture or Cache2kBuilder

    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.

    The cache type is immutable.

    See Also:
    CacheTypeCapture, ReflectionExplained - Google Guava Documentation
    • Field Detail


        static final String DESCRIPTOR_TO_STRING_PREFIX
        The used prefix for the toString() output.
        See Also:
        Constant Field Values
    • Method Detail

      • hasTypeArguments

        boolean hasTypeArguments()
        The type has generic type parameters and the concrete types are known. getTypeArguments() returns the the arguments.
      • isArray

        boolean isArray()
        This type is an array. To analyze a multi dimensional array descend to the component, for example getComponentType().isArray().
        See Also:
      • getTypeName

        String getTypeName()
        Java language compatible type name