File tree Expand file tree Collapse file tree 3 files changed +17
-7
lines changed
org.springframework.context/src/main/java/org/springframework/cache Expand file tree Collapse file tree 3 files changed +17
-7
lines changed Original file line number Diff line number Diff line change 21
21
import java .util .concurrent .ConcurrentMap ;
22
22
23
23
import org .springframework .cache .Cache ;
24
- import org .springframework .cache .support .ValueWrapperImpl ;
24
+ import org .springframework .cache .support .SimpleValueWrapper ;
25
25
26
26
/**
27
27
* Simple {@link Cache} implementation based on the core JDK
@@ -96,7 +96,7 @@ public boolean isAllowNullValues() {
96
96
97
97
public ValueWrapper get (Object key ) {
98
98
Object value = this .store .get (key );
99
- return (value != null ? new ValueWrapperImpl (fromStoreValue (value )) : null );
99
+ return (value != null ? new SimpleValueWrapper (fromStoreValue (value )) : null );
100
100
}
101
101
102
102
public void put (Object key , Object value ) {
Original file line number Diff line number Diff line change 21
21
import net .sf .ehcache .Status ;
22
22
23
23
import org .springframework .cache .Cache ;
24
- import org .springframework .cache .support .ValueWrapperImpl ;
24
+ import org .springframework .cache .support .SimpleValueWrapper ;
25
25
import org .springframework .util .Assert ;
26
26
27
27
/**
@@ -63,7 +63,7 @@ public void clear() {
63
63
64
64
public ValueWrapper get (Object key ) {
65
65
Element element = this .cache .get (key );
66
- return (element != null ? new ValueWrapperImpl (element .getObjectValue ()) : null );
66
+ return (element != null ? new SimpleValueWrapper (element .getObjectValue ()) : null );
67
67
}
68
68
69
69
public void put (Object key , Object value ) {
Original file line number Diff line number Diff line change 19
19
import org .springframework .cache .Cache .ValueWrapper ;
20
20
21
21
/**
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()}.
23
24
*
24
25
* @author Costin Leau
25
26
* @since 3.1
26
27
*/
27
- public class ValueWrapperImpl implements ValueWrapper {
28
+ public class SimpleValueWrapper implements ValueWrapper {
28
29
29
30
private final Object value ;
30
31
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 ) {
32
38
this .value = value ;
33
39
}
34
40
41
+
42
+ /**
43
+ * Simply returns the value as given at construction time.
44
+ */
35
45
public Object get () {
36
46
return this .value ;
37
47
}
You can’t perform that action at this time.
0 commit comments