Annotation Type Cacheable


  • @Target({METHOD,TYPE})
    @Retention(RUNTIME)
    @Inherited
    @Documented
    @CacheConfig
    @CacheAnnotation
    public @interface Cacheable

    An annotation that can be applied at the type or method level to indicate that the return value of the method should be cached for the configured cacheNames().

    Since:
    1.0
      • parameters

        java.lang.String[] parameters
        Limit the automatic CacheKeyGenerator to the given parameter names. Mutually exclusive with keyGenerator()
        Returns:
        The parameter names that make up the key.
        Default:
        {}
      • atomic

        boolean atomic

        Whether an atomic operation should be attempted to retrieve the cache value. This will call SyncCache.get(Object, Class, java.util.function.Supplier) if set to true otherwise SyncCache.get(Object, Class) will be called which is non-atomic

        Note that atomic operations will pick the first cache name specified and ignore the remaining.

        Returns:
        True if an atomic operation should be attempted
        Default:
        false