1
1
package io .tarantool .driver .api .tuple ;
2
2
3
- import io .tarantool .driver .protocol .Packable ;
4
-
5
3
import java .math .BigDecimal ;
4
+ import java .time .Instant ;
6
5
import java .util .List ;
7
6
import java .util .Map ;
8
7
import java .util .Optional ;
9
8
import java .util .UUID ;
10
9
10
+ import io .tarantool .driver .protocol .Packable ;
11
+
11
12
/**
12
13
* Basic Tarantool atom of data
13
14
*
@@ -17,7 +18,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
17
18
/**
18
19
* Get a tuple field by its position
19
20
*
20
- * @param fieldPosition the field position from the the tuple start, starting from 0
21
+ * @param fieldPosition the field position from the tuple start, starting from 0
21
22
* @return field or empty optional if the field position is out of tuple length
22
23
*/
23
24
Optional <TarantoolField > getField (int fieldPosition );
@@ -40,7 +41,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
40
41
/**
41
42
* Get a tuple field value by its position specifying the target value type
42
43
*
43
- * @param fieldPosition field position from the the tuple start, starting from 0
44
+ * @param fieldPosition field position from the tuple start, starting from 0
44
45
* @param objectClass target value type class
45
46
* @param <O> target value type
46
47
* @return nullable value of a field wrapped in Optional, possibly converted to a Java type
@@ -50,7 +51,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
50
51
/**
51
52
* Check if a tuple field exists and can be converted to the target value type
52
53
*
53
- * @param fieldPosition field position from the the tuple start, starting from 0
54
+ * @param fieldPosition field position from the tuple start, starting from 0
54
55
* @param objectClass target value type class
55
56
* @return true, if the field exists and can be converted to the given type, false otherwise
56
57
*/
@@ -78,7 +79,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
78
79
/**
79
80
* Get a tuple field value as a raw object
80
81
*
81
- * @param fieldPosition field position from the the tuple start, starting from 0
82
+ * @param fieldPosition field position from the tuple start, starting from 0
82
83
* @return nullable value of a field wrapped in Optional
83
84
*/
84
85
Optional <?> getObject (int fieldPosition );
@@ -101,7 +102,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
101
102
/**
102
103
* Set a tuple field by field position
103
104
*
104
- * @param fieldPosition the field position from the the tuple start, starting from 0
105
+ * @param fieldPosition the field position from the tuple start, starting from 0
105
106
* @param field new field
106
107
*/
107
108
void setField (int fieldPosition , TarantoolField field );
@@ -117,7 +118,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
117
118
/**
118
119
* Set a tuple field value from an object by field position
119
120
*
120
- * @param fieldPosition the field position from the the tuple start, starting from 0
121
+ * @param fieldPosition the field position from the tuple start, starting from 0
121
122
* @param value new field value
122
123
*/
123
124
void putObject (int fieldPosition , Object value );
@@ -133,7 +134,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
133
134
/**
134
135
* Get the field value converted to {@code byte[]}
135
136
*
136
- * @param fieldPosition the field position from the the tuple start, starting from 0
137
+ * @param fieldPosition the field position from the tuple start, starting from 0
137
138
* @return value
138
139
*/
139
140
byte [] getByteArray (int fieldPosition );
@@ -149,7 +150,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
149
150
/**
150
151
* Get the field value converted to {@code Boolean}
151
152
*
152
- * @param fieldPosition the field position from the the tuple start, starting from 0
153
+ * @param fieldPosition the field position from the tuple start, starting from 0
153
154
* @return value
154
155
*/
155
156
Boolean getBoolean (int fieldPosition );
@@ -165,7 +166,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
165
166
/**
166
167
* Get the field value converted to {@code Double}
167
168
*
168
- * @param fieldPosition the field position from the the tuple start, starting from 0
169
+ * @param fieldPosition the field position from the tuple start, starting from 0
169
170
* @return value
170
171
*/
171
172
Double getDouble (int fieldPosition );
@@ -181,7 +182,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
181
182
/**
182
183
* Get the field value converted to {@code Float}
183
184
*
184
- * @param fieldPosition the field position from the the tuple start, starting from 0
185
+ * @param fieldPosition the field position from the tuple start, starting from 0
185
186
* @return value
186
187
*/
187
188
Float getFloat (int fieldPosition );
@@ -197,7 +198,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
197
198
/**
198
199
* Get the field value converted to {@code Integer}
199
200
*
200
- * @param fieldPosition the field position from the the tuple start, starting from 0
201
+ * @param fieldPosition the field position from the tuple start, starting from 0
201
202
* @return value
202
203
*/
203
204
Integer getInteger (int fieldPosition );
@@ -213,7 +214,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
213
214
/**
214
215
* Get the field value converted to {@code Long}
215
216
*
216
- * @param fieldPosition the field position from the the tuple start, starting from 0
217
+ * @param fieldPosition the field position from the tuple start, starting from 0
217
218
* @return value
218
219
*/
219
220
Long getLong (int fieldPosition );
@@ -229,7 +230,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
229
230
/**
230
231
* Get the field value converted to {@code String}
231
232
*
232
- * @param fieldPosition the field position from the the tuple start, starting from 0
233
+ * @param fieldPosition the field position from the tuple start, starting from 0
233
234
* @return value
234
235
*/
235
236
String getString (int fieldPosition );
@@ -245,7 +246,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
245
246
/**
246
247
* Get the field value converted to {@code Character}
247
248
*
248
- * @param fieldPosition the field position from the the tuple start, starting from 0
249
+ * @param fieldPosition the field position from the tuple start, starting from 0
249
250
* @return value
250
251
*/
251
252
Character getCharacter (int fieldPosition );
@@ -261,7 +262,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
261
262
/**
262
263
* Get the field value converted to {@link UUID}
263
264
*
264
- * @param fieldPosition the field position from the the tuple start, starting from 0
265
+ * @param fieldPosition the field position from the tuple start, starting from 0
265
266
* @return value
266
267
*/
267
268
UUID getUUID (int fieldPosition );
@@ -274,10 +275,26 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
274
275
*/
275
276
UUID getUUID (String fieldName );
276
277
278
+ /**
279
+ * Get the field value converted to {@link Instant}
280
+ *
281
+ * @param fieldPosition the field position from the tuple start, starting from 0
282
+ * @return value
283
+ */
284
+ Instant getInstant (int fieldPosition );
285
+
286
+ /**
287
+ * Get the field value converted to {@link Instant}
288
+ *
289
+ * @param fieldName the field name, must not be null
290
+ * @return value
291
+ */
292
+ Instant getInstant (String fieldName );
293
+
277
294
/**
278
295
* Get the field value converted to {@link BigDecimal}
279
296
*
280
- * @param fieldPosition the field position from the the tuple start, starting from 0
297
+ * @param fieldPosition the field position from the tuple start, starting from 0
281
298
* @return value
282
299
*/
283
300
BigDecimal getDecimal (int fieldPosition );
@@ -293,7 +310,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
293
310
/**
294
311
* Get the field value converted to {@link List}
295
312
*
296
- * @param fieldPosition the field position from the the tuple start, starting from 0
313
+ * @param fieldPosition the field position from the tuple start, starting from 0
297
314
* @return value
298
315
*/
299
316
List <?> getList (int fieldPosition );
@@ -309,7 +326,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
309
326
/**
310
327
* Get the field value converted to {@link Map}
311
328
*
312
- * @param fieldPosition the field position from the the tuple start, starting from 0
329
+ * @param fieldPosition the field position from the tuple start, starting from 0
313
330
* @return value
314
331
*/
315
332
Map <?, ?> getMap (int fieldPosition );
0 commit comments