Interface CacheKeyPrefix

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface CacheKeyPrefix
CacheKeyPrefix provides a hook for creating custom prefixes prepended to the actual key stored in Couchbase.
Since:
4.0.0
Author:
Christoph Strobl, Mark Paluch, Michael Nitschinger
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Default separator.
  • Method Summary

    Modifier and Type
    Method
    Description
    compute(String cacheName)
    Compute the prefix for the actual key stored in Couchbase.
    prefixed(String prefix)
    Creates a CacheKeyPrefix scheme that prefixes cache keys with the given prefix.
    Creates a default CacheKeyPrefix scheme that prefixes cache keys with cacheName followed by double colons.
  • Field Details

  • Method Details

    • simple

      static CacheKeyPrefix simple()
      Creates a default CacheKeyPrefix scheme that prefixes cache keys with cacheName followed by double colons. A cache named myCache will prefix all cache keys with myCache::.
      Returns:
      the default CacheKeyPrefix scheme.
    • prefixed

      static CacheKeyPrefix prefixed(String prefix)
      Creates a CacheKeyPrefix scheme that prefixes cache keys with the given prefix. The prefix is prepended to the cacheName followed by double colons. A prefix cb- with a cache named myCache results in cb-myCache::.
      Parameters:
      prefix - must not be null.
      Returns:
      the default CacheKeyPrefix scheme.
      Since:
      4.0.0
    • compute

      String compute(String cacheName)
      Compute the prefix for the actual key stored in Couchbase.
      Parameters:
      cacheName - will never be null.
      Returns:
      never null.