25
25
26
26
/**
27
27
* Interface that specifies a basic set of key/value operations. Implemented by {@link KeyValueTemplate}.
28
- *
28
+ *
29
29
* @author Christoph Strobl
30
30
*/
31
31
public interface KeyValueOperations extends DisposableBean {
32
32
33
33
/**
34
34
* Add given object. Object needs to have id property to which a generated value will be assigned.
35
- *
35
+ *
36
36
* @param objectToInsert
37
37
* @return
38
38
*/
39
39
<T > T insert (T objectToInsert );
40
40
41
41
/**
42
42
* Add object with given id.
43
- *
43
+ *
44
44
* @param id must not be {@literal null}.
45
45
* @param objectToInsert must not be {@literal null}.
46
46
*/
@@ -49,7 +49,7 @@ public interface KeyValueOperations extends DisposableBean {
49
49
/**
50
50
* Get all elements of given type. Respects {@link KeySpace} if present and therefore returns all elements that can be
51
51
* assigned to requested type.
52
- *
52
+ *
53
53
* @param type must not be {@literal null}.
54
54
* @return empty iterable if no elements found.
55
55
*/
@@ -58,7 +58,7 @@ public interface KeyValueOperations extends DisposableBean {
58
58
/**
59
59
* Get all elements ordered by sort. Respects {@link KeySpace} if present and therefore returns all elements that can
60
60
* be assigned to requested type.
61
- *
61
+ *
62
62
* @param sort must not be {@literal null}.
63
63
* @param type must not be {@literal null}.
64
64
* @return
@@ -68,16 +68,16 @@ public interface KeyValueOperations extends DisposableBean {
68
68
/**
69
69
* Get element of given type with given id. Respects {@link KeySpace} if present and therefore returns all elements
70
70
* that can be assigned to requested type.
71
- *
71
+ *
72
72
* @param id must not be {@literal null}.
73
73
* @param type must not be {@literal null}.
74
- * @return null if not found.
74
+ * @return {@link Optional#empty()} if not found.
75
75
*/
76
76
<T > Optional <T > findById (Object id , Class <T > type );
77
77
78
78
/**
79
79
* Execute operation against underlying store.
80
- *
80
+ *
81
81
* @param action must not be {@literal null}.
82
82
* @return
83
83
*/
@@ -86,7 +86,7 @@ public interface KeyValueOperations extends DisposableBean {
86
86
/**
87
87
* Get all elements matching the given query. <br />
88
88
* Respects {@link KeySpace} if present and therefore returns all elements that can be assigned to requested type..
89
- *
89
+ *
90
90
* @param query must not be {@literal null}.
91
91
* @param type must not be {@literal null}.
92
92
* @return empty iterable if no match found.
@@ -96,7 +96,7 @@ public interface KeyValueOperations extends DisposableBean {
96
96
/**
97
97
* Get all elements in given range. Respects {@link KeySpace} if present and therefore returns all elements that can
98
98
* be assigned to requested type.
99
- *
99
+ *
100
100
* @param offset
101
101
* @param rows
102
102
* @param type must not be {@literal null}.
@@ -107,7 +107,7 @@ public interface KeyValueOperations extends DisposableBean {
107
107
/**
108
108
* Get all elements in given range ordered by sort. Respects {@link KeySpace} if present and therefore returns all
109
109
* elements that can be assigned to requested type.
110
- *
110
+ *
111
111
* @param offset
112
112
* @param rows
113
113
* @param sort
@@ -130,7 +130,7 @@ public interface KeyValueOperations extends DisposableBean {
130
130
/**
131
131
* Remove all elements of type. Respects {@link KeySpace} if present and therefore removes all elements that can be
132
132
* assigned to requested type.
133
- *
133
+ *
134
134
* @param type must not be {@literal null}.
135
135
*/
136
136
void delete (Class <?> type );
@@ -143,7 +143,7 @@ public interface KeyValueOperations extends DisposableBean {
143
143
144
144
/**
145
145
* Delete item of type with given id.
146
- *
146
+ *
147
147
* @param id must not be {@literal null}.
148
148
* @param type must not be {@literal null}.
149
149
* @return the deleted item or {@literal null} if no match found.
@@ -153,7 +153,7 @@ public interface KeyValueOperations extends DisposableBean {
153
153
/**
154
154
* Total number of elements with given type available. Respects {@link KeySpace} if present and therefore counts all
155
155
* elements that can be assigned to requested type.
156
- *
156
+ *
157
157
* @param type must not be {@literal null}.
158
158
* @return
159
159
*/
@@ -162,7 +162,7 @@ public interface KeyValueOperations extends DisposableBean {
162
162
/**
163
163
* Total number of elements matching given query. Respects {@link KeySpace} if present and therefore counts all
164
164
* elements that can be assigned to requested type.
165
- *
165
+ *
166
166
* @param query
167
167
* @param type
168
168
* @return
0 commit comments