Skip to content

Commit bba70a7

Browse files
committed
renamed ValueWrapperImpl to SimpleValueWrapper (for use in Cache implementations)
1 parent 372d461 commit bba70a7

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

org.springframework.context/src/main/java/org/springframework/cache/concurrent/ConcurrentMapCache.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import java.util.concurrent.ConcurrentMap;
2222

2323
import org.springframework.cache.Cache;
24-
import org.springframework.cache.support.ValueWrapperImpl;
24+
import org.springframework.cache.support.SimpleValueWrapper;
2525

2626
/**
2727
* Simple {@link Cache} implementation based on the core JDK
@@ -96,7 +96,7 @@ public boolean isAllowNullValues() {
9696

9797
public ValueWrapper get(Object key) {
9898
Object value = this.store.get(key);
99-
return (value != null ? new ValueWrapperImpl(fromStoreValue(value)) : null);
99+
return (value != null ? new SimpleValueWrapper(fromStoreValue(value)) : null);
100100
}
101101

102102
public void put(Object key, Object value) {

org.springframework.context/src/main/java/org/springframework/cache/ehcache/EhCacheCache.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import net.sf.ehcache.Status;
2222

2323
import org.springframework.cache.Cache;
24-
import org.springframework.cache.support.ValueWrapperImpl;
24+
import org.springframework.cache.support.SimpleValueWrapper;
2525
import org.springframework.util.Assert;
2626

2727
/**
@@ -63,7 +63,7 @@ public void clear() {
6363

6464
public ValueWrapper get(Object key) {
6565
Element element = this.cache.get(key);
66-
return (element != null ? new ValueWrapperImpl(element.getObjectValue()) : null);
66+
return (element != null ? new SimpleValueWrapper(element.getObjectValue()) : null);
6767
}
6868

6969
public void put(Object key, Object value) {

org.springframework.context/src/main/java/org/springframework/cache/support/ValueWrapperImpl.java renamed to org.springframework.context/src/main/java/org/springframework/cache/support/SimpleValueWrapper.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,29 @@
1919
import org.springframework.cache.Cache.ValueWrapper;
2020

2121
/**
22-
* Straightforward implementation of {@link org.springframework.cache.Cache.ValueWrapper}.
22+
* Straightforward implementation of {@link org.springframework.cache.Cache.ValueWrapper},
23+
* simply holding the value as given at construction and returning it from {@link #get()}.
2324
*
2425
* @author Costin Leau
2526
* @since 3.1
2627
*/
27-
public class ValueWrapperImpl implements ValueWrapper {
28+
public class SimpleValueWrapper implements ValueWrapper {
2829

2930
private final Object value;
3031

31-
public ValueWrapperImpl(Object value) {
32+
33+
/**
34+
* Create a new SimpleValueWrapper instance for exposing the given value.
35+
* @param value the value to expose (may be <code>null</code>)
36+
*/
37+
public SimpleValueWrapper(Object value) {
3238
this.value = value;
3339
}
3440

41+
42+
/**
43+
* Simply returns the value as given at construction time.
44+
*/
3545
public Object get() {
3646
return this.value;
3747
}

0 commit comments

Comments
 (0)