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
*
@@ -24,7 +25,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
24
25
/**
25
26
* Get a tuple field by its position
26
27
*
27
- * @param fieldPosition the field position from the the tuple start, starting from 0
28
+ * @param fieldPosition the field position from the tuple start, starting from 0
28
29
* @return field or empty optional if the field position is out of tuple length
29
30
*/
30
31
Optional <TarantoolField > getField (int fieldPosition );
@@ -47,7 +48,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
47
48
/**
48
49
* Get a tuple field value by its position specifying the target value type
49
50
*
50
- * @param fieldPosition field position from the the tuple start, starting from 0
51
+ * @param fieldPosition field position from the tuple start, starting from 0
51
52
* @param objectClass target value type class
52
53
* @param <O> target value type
53
54
* @return nullable value of a field wrapped in Optional, possibly converted to a Java type
@@ -57,7 +58,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
57
58
/**
58
59
* Check if a tuple field exists and can be converted to the target value type
59
60
*
60
- * @param fieldPosition field position from the the tuple start, starting from 0
61
+ * @param fieldPosition field position from the tuple start, starting from 0
61
62
* @param objectClass target value type class
62
63
* @return true, if the field exists and can be converted to the given type, false otherwise
63
64
*/
@@ -85,7 +86,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
85
86
/**
86
87
* Get a tuple field value as a raw object
87
88
*
88
- * @param fieldPosition field position from the the tuple start, starting from 0
89
+ * @param fieldPosition field position from the tuple start, starting from 0
89
90
* @return nullable value of a field wrapped in Optional
90
91
*/
91
92
Optional <?> getObject (int fieldPosition );
@@ -108,7 +109,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
108
109
/**
109
110
* Set a tuple field by field position
110
111
*
111
- * @param fieldPosition the field position from the the tuple start, starting from 0
112
+ * @param fieldPosition the field position from the tuple start, starting from 0
112
113
* @param field new field
113
114
*/
114
115
void setField (int fieldPosition , TarantoolField field );
@@ -124,7 +125,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
124
125
/**
125
126
* Set a tuple field value from an object by field position
126
127
*
127
- * @param fieldPosition the field position from the the tuple start, starting from 0
128
+ * @param fieldPosition the field position from the tuple start, starting from 0
128
129
* @param value new field value
129
130
*/
130
131
void putObject (int fieldPosition , Object value );
@@ -140,7 +141,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
140
141
/**
141
142
* Get the field value converted to {@code byte[]}
142
143
*
143
- * @param fieldPosition the field position from the the tuple start, starting from 0
144
+ * @param fieldPosition the field position from the tuple start, starting from 0
144
145
* @return value
145
146
*/
146
147
byte [] getByteArray (int fieldPosition );
@@ -156,7 +157,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
156
157
/**
157
158
* Get the field value converted to {@code Boolean}
158
159
*
159
- * @param fieldPosition the field position from the the tuple start, starting from 0
160
+ * @param fieldPosition the field position from the tuple start, starting from 0
160
161
* @return value
161
162
*/
162
163
Boolean getBoolean (int fieldPosition );
@@ -172,7 +173,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
172
173
/**
173
174
* Get the field value converted to {@code Double}
174
175
*
175
- * @param fieldPosition the field position from the the tuple start, starting from 0
176
+ * @param fieldPosition the field position from the tuple start, starting from 0
176
177
* @return value
177
178
*/
178
179
Double getDouble (int fieldPosition );
@@ -188,7 +189,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
188
189
/**
189
190
* Get the field value converted to {@code Float}
190
191
*
191
- * @param fieldPosition the field position from the the tuple start, starting from 0
192
+ * @param fieldPosition the field position from the tuple start, starting from 0
192
193
* @return value
193
194
*/
194
195
Float getFloat (int fieldPosition );
@@ -204,7 +205,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
204
205
/**
205
206
* Get the field value converted to {@code Integer}
206
207
*
207
- * @param fieldPosition the field position from the the tuple start, starting from 0
208
+ * @param fieldPosition the field position from the tuple start, starting from 0
208
209
* @return value
209
210
*/
210
211
Integer getInteger (int fieldPosition );
@@ -220,7 +221,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
220
221
/**
221
222
* Get the field value converted to {@code Long}
222
223
*
223
- * @param fieldPosition the field position from the the tuple start, starting from 0
224
+ * @param fieldPosition the field position from the tuple start, starting from 0
224
225
* @return value
225
226
*/
226
227
Long getLong (int fieldPosition );
@@ -236,7 +237,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
236
237
/**
237
238
* Get the field value converted to {@code String}
238
239
*
239
- * @param fieldPosition the field position from the the tuple start, starting from 0
240
+ * @param fieldPosition the field position from the tuple start, starting from 0
240
241
* @return value
241
242
*/
242
243
String getString (int fieldPosition );
@@ -252,7 +253,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
252
253
/**
253
254
* Get the field value converted to {@code Character}
254
255
*
255
- * @param fieldPosition the field position from the the tuple start, starting from 0
256
+ * @param fieldPosition the field position from the tuple start, starting from 0
256
257
* @return value
257
258
*/
258
259
Character getCharacter (int fieldPosition );
@@ -268,7 +269,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
268
269
/**
269
270
* Get the field value converted to {@link UUID}
270
271
*
271
- * @param fieldPosition the field position from the the tuple start, starting from 0
272
+ * @param fieldPosition the field position from the tuple start, starting from 0
272
273
* @return value
273
274
*/
274
275
UUID getUUID (int fieldPosition );
@@ -281,10 +282,26 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
281
282
*/
282
283
UUID getUUID (String fieldName );
283
284
285
+ /**
286
+ * Get the field value converted to {@link Instant}
287
+ *
288
+ * @param fieldPosition the field position from the tuple start, starting from 0
289
+ * @return value
290
+ */
291
+ Instant getInstant (int fieldPosition );
292
+
293
+ /**
294
+ * Get the field value converted to {@link Instant}
295
+ *
296
+ * @param fieldName the field name, must not be null
297
+ * @return value
298
+ */
299
+ Instant getInstant (String fieldName );
300
+
284
301
/**
285
302
* Get the field value converted to {@link BigDecimal}
286
303
*
287
- * @param fieldPosition the field position from the the tuple start, starting from 0
304
+ * @param fieldPosition the field position from the tuple start, starting from 0
288
305
* @return value
289
306
*/
290
307
BigDecimal getDecimal (int fieldPosition );
@@ -300,7 +317,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
300
317
/**
301
318
* Get the field value converted to {@link List}
302
319
*
303
- * @param fieldPosition the field position from the the tuple start, starting from 0
320
+ * @param fieldPosition the field position from the tuple start, starting from 0
304
321
* @return value
305
322
*/
306
323
List <?> getList (int fieldPosition );
@@ -316,7 +333,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
316
333
/**
317
334
* Get the field value converted to {@link Map}
318
335
*
319
- * @param fieldPosition the field position from the the tuple start, starting from 0
336
+ * @param fieldPosition the field position from the tuple start, starting from 0
320
337
* @return value
321
338
*/
322
339
Map <?, ?> getMap (int fieldPosition );
0 commit comments