diff --git a/spring-context/src/main/java/org/springframework/cache/annotation/CacheEvict.java b/spring-context/src/main/java/org/springframework/cache/annotation/CacheEvict.java index 5aa3978852..7ae0930580 100644 --- a/spring-context/src/main/java/org/springframework/cache/annotation/CacheEvict.java +++ b/spring-context/src/main/java/org/springframework/cache/annotation/CacheEvict.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -111,7 +111,8 @@ public @interface CacheEvict { /** * Spring Expression Language (SpEL) expression used for making the cache - * eviction operation conditional. + * eviction operation conditional. Evict that cache if the condition evaluates + * to {@code true}. *
Default is {@code ""}, meaning the cache eviction is always performed. *
The SpEL expression evaluates against a dedicated context that provides the * following meta-data: diff --git a/spring-context/src/main/java/org/springframework/cache/annotation/CachePut.java b/spring-context/src/main/java/org/springframework/cache/annotation/CachePut.java index abf47bfd0f..d711fe4fc0 100644 --- a/spring-context/src/main/java/org/springframework/cache/annotation/CachePut.java +++ b/spring-context/src/main/java/org/springframework/cache/annotation/CachePut.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -118,7 +118,8 @@ public @interface CachePut { /** * Spring Expression Language (SpEL) expression used for making the cache - * put operation conditional. + * put operation conditional. Update the cache if the condition evaluates to + * {@code true}. *
This expression is evaluated after the method has been called due to the * nature of the put operation and can therefore refer to the {@code result}. *
Default is {@code ""}, meaning the method result is always cached. @@ -142,6 +143,7 @@ public @interface CachePut { /** * Spring Expression Language (SpEL) expression used to veto the cache put operation. + * Veto updating the cache if the condition evaluates to {@code true}. *
Default is {@code ""}, meaning that caching is never vetoed. *
The SpEL expression evaluates against a dedicated context that provides the * following meta-data: diff --git a/spring-context/src/main/java/org/springframework/cache/annotation/Cacheable.java b/spring-context/src/main/java/org/springframework/cache/annotation/Cacheable.java index 85965cbffa..6d626e7832 100644 --- a/spring-context/src/main/java/org/springframework/cache/annotation/Cacheable.java +++ b/spring-context/src/main/java/org/springframework/cache/annotation/Cacheable.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -123,8 +123,8 @@ public @interface Cacheable { /** * Spring Expression Language (SpEL) expression used for making the method - * caching conditional. If condition is evaluated to {@code true}, result - * is cached. + * caching conditional. Cache the result if the condition evaluates to + * {@code true}. *
Default is {@code ""}, meaning the method result is always cached. *
The SpEL expression evaluates against a dedicated context that provides the * following meta-data: @@ -143,6 +143,7 @@ public @interface Cacheable { /** * Spring Expression Language (SpEL) expression used to veto method caching. + * Veto caching the result if the condition evaluates to {@code true}. *
Unlike {@link #condition}, this expression is evaluated after the method * has been called and can therefore refer to the {@code result}. *
Default is {@code ""}, meaning that caching is never vetoed.