Interface InternalEntryFactory

    • Method Detail

      • create

        <K,​V> InternalCacheEntry<K,​V> create​(CacheEntry<K,​V> cacheEntry)
        Creates a new InternalCacheEntry instance based on the key, value, version and timestamp/lifespan information reflected in the CacheEntry instance passed in.
        Type Parameters:
        K - The key type for the entry
        V - The value type for the entry
        Parameters:
        cacheEntry - cache entry to copy
        Returns:
        a new InternalCacheEntry
      • create

        <K,​V> InternalCacheEntry<K,​V> create​(K key,
                                                         V value,
                                                         InternalCacheEntry<?,​?> cacheEntry)
        Creates a new InternalCacheEntry instance based on the version and timestamp/lifespan information reflected in the CacheEntry instance passed in. Key and value are both passed in explicitly.
        Type Parameters:
        K - The key type for the entry
        V - The value type for the entry
        Parameters:
        key - key to use
        value - value to use
        cacheEntry - cache entry to retrieve version and timestamp/lifespan information from
        Returns:
        a new InternalCacheEntry
      • create

        <K,​V> InternalCacheEntry<K,​V> create​(K key,
                                                         V value,
                                                         Metadata metadata)
        Creates a new InternalCacheEntry instance
        Type Parameters:
        K - The key type for the entry
        V - The value type for the entry
        Parameters:
        key - key to use
        value - value to use
        metadata - metadata for entry
        Returns:
        a new InternalCacheEntry
      • create

        <K,​V> InternalCacheEntry<K,​V> create​(K key,
                                                         V value,
                                                         Metadata metadata,
                                                         long lifespan,
                                                         long maxIdle)
        Creates a new InternalCacheEntry instance
        Type Parameters:
        K - The key type for the entry
        V - The value type for the entry
        Parameters:
        key - key to use
        value - value to use
        metadata - metadata for entry
        lifespan - lifespan to use
        maxIdle - maxIdle to use
        Returns:
        a new InternalCacheEntry
      • create

        <K,​V> InternalCacheEntry<K,​V> create​(K key,
                                                         V value,
                                                         Metadata metadata,
                                                         long created,
                                                         long lifespan,
                                                         long lastUsed,
                                                         long maxIdle)
        Creates a new InternalCacheEntry instance
        Type Parameters:
        K - The key type for the entry
        V - The value type for the entry
        Parameters:
        key - key to use
        value - value to use
        metadata - metadata for entry
        created - creation timestamp to use
        lifespan - lifespan to use
        lastUsed - lastUsed timestamp to use
        maxIdle - maxIdle to use
        Returns:
        a new InternalCacheEntry
      • create

        <K,​V> InternalCacheEntry<K,​V> create​(K key,
                                                         V value,
                                                         EntryVersion version,
                                                         long created,
                                                         long lifespan,
                                                         long lastUsed,
                                                         long maxIdle)
        Creates a new InternalCacheEntry instance
        Type Parameters:
        K - The key type for the entry
        V - The value type for the entry
        Parameters:
        key - key to use
        value - value to use
        version - version to use
        created - creation timestamp to use
        lifespan - lifespan to use
        lastUsed - lastUsed timestamp to use
        maxIdle - maxIdle to use
        Returns:
        a new InternalCacheEntry
      • update

        <K,​V> InternalCacheEntry<K,​V> update​(InternalCacheEntry<K,​V> cacheEntry,
                                                         Metadata metadata)
        TODO: Adjust javadoc Updates an existing InternalCacheEntry with new metadata. This may result in a new InternalCacheEntry instance being created, as a different InternalCacheEntry implementation may be more appropriate to suit the new metadata values. As such, one should consider the InternalCacheEntry passed in as a parameter as passed by value and not by reference.
        Type Parameters:
        K - The key type for the entry
        V - The value type for the entry
        Parameters:
        cacheEntry - original internal cache entry
        metadata - new metadata
        Returns:
        a new InternalCacheEntry instance
      • createL1

        <K,​V> InternalCacheEntry<K,​V> createL1​(K key,
                                                           V value,
                                                           Metadata metadata)
        Creates a L1 entry.
        Type Parameters:
        K - The key type for the entry
        V - The value type for the entry
        Parameters:
        key -
        value -
        Returns:
        a new InternalCacheEntry