3
3
import io .tarantool .driver .protocol .Packable ;
4
4
5
5
import java .math .BigDecimal ;
6
+ import java .time .Instant ;
6
7
import java .util .List ;
7
8
import java .util .Map ;
8
9
import java .util .Optional ;
16
17
public interface TarantoolTuple extends Iterable <TarantoolField >, Packable {
17
18
/**
18
19
* Get a tuple field by its position
19
- * @param fieldPosition the field position from the the tuple start, starting from 0
20
+ * @param fieldPosition the field position from the tuple start, starting from 0
20
21
* @return field or empty optional if the field position is out of tuple length
21
22
*/
22
23
Optional <TarantoolField > getField (int fieldPosition );
@@ -38,7 +39,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
38
39
39
40
/**
40
41
* Get a tuple field value by its position specifying the target value type
41
- * @param fieldPosition field position from the the tuple start, starting from 0
42
+ * @param fieldPosition field position from the tuple start, starting from 0
42
43
* @param objectClass target value type class
43
44
* @param <O> target value type
44
45
* @return nullable value of a field wrapped in Optional, possibly converted to a Java type
@@ -47,7 +48,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
47
48
48
49
/**
49
50
* Check if a tuple field exists and can be converted to the target value type
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
* @return true, if the field exists and can be converted to the given type, false otherwise
53
54
*/
@@ -72,7 +73,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
72
73
73
74
/**
74
75
* Get a tuple field value as a raw object
75
- * @param fieldPosition field position from the the tuple start, starting from 0
76
+ * @param fieldPosition field position from the tuple start, starting from 0
76
77
* @return nullable value of a field wrapped in Optional
77
78
*/
78
79
Optional <?> getObject (int fieldPosition );
@@ -94,7 +95,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
94
95
/**
95
96
* Set a tuple field by field position
96
97
*
97
- * @param fieldPosition the field position from the the tuple start, starting from 0
98
+ * @param fieldPosition the field position from the tuple start, starting from 0
98
99
* @param field new field
99
100
*/
100
101
void setField (int fieldPosition , TarantoolField field );
@@ -110,7 +111,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
110
111
/**
111
112
* Set a tuple field value from an object by field position
112
113
*
113
- * @param fieldPosition the field position from the the tuple start, starting from 0
114
+ * @param fieldPosition the field position from the tuple start, starting from 0
114
115
* @param value new field value
115
116
*/
116
117
void putObject (int fieldPosition , Object value );
@@ -126,7 +127,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
126
127
/**
127
128
* Get the field value converted to {@code byte[]}
128
129
*
129
- * @param fieldPosition the field position from the the tuple start, starting from 0
130
+ * @param fieldPosition the field position from the tuple start, starting from 0
130
131
* @return value
131
132
*/
132
133
byte [] getByteArray (int fieldPosition );
@@ -142,7 +143,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
142
143
/**
143
144
* Get the field value converted to {@code Boolean}
144
145
*
145
- * @param fieldPosition the field position from the the tuple start, starting from 0
146
+ * @param fieldPosition the field position from the tuple start, starting from 0
146
147
* @return value
147
148
*/
148
149
Boolean getBoolean (int fieldPosition );
@@ -158,7 +159,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
158
159
/**
159
160
* Get the field value converted to {@code Double}
160
161
*
161
- * @param fieldPosition the field position from the the tuple start, starting from 0
162
+ * @param fieldPosition the field position from the tuple start, starting from 0
162
163
* @return value
163
164
*/
164
165
Double getDouble (int fieldPosition );
@@ -174,7 +175,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
174
175
/**
175
176
* Get the field value converted to {@code Float}
176
177
*
177
- * @param fieldPosition the field position from the the tuple start, starting from 0
178
+ * @param fieldPosition the field position from the tuple start, starting from 0
178
179
* @return value
179
180
*/
180
181
Float getFloat (int fieldPosition );
@@ -190,7 +191,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
190
191
/**
191
192
* Get the field value converted to {@code Integer}
192
193
*
193
- * @param fieldPosition the field position from the the tuple start, starting from 0
194
+ * @param fieldPosition the field position from the tuple start, starting from 0
194
195
* @return value
195
196
*/
196
197
Integer getInteger (int fieldPosition );
@@ -206,7 +207,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
206
207
/**
207
208
* Get the field value converted to {@code Long}
208
209
*
209
- * @param fieldPosition the field position from the the tuple start, starting from 0
210
+ * @param fieldPosition the field position from the tuple start, starting from 0
210
211
* @return value
211
212
*/
212
213
Long getLong (int fieldPosition );
@@ -222,7 +223,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
222
223
/**
223
224
* Get the field value converted to {@code String}
224
225
*
225
- * @param fieldPosition the field position from the the tuple start, starting from 0
226
+ * @param fieldPosition the field position from the tuple start, starting from 0
226
227
* @return value
227
228
*/
228
229
String getString (int fieldPosition );
@@ -238,7 +239,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
238
239
/**
239
240
* Get the field value converted to {@code Character}
240
241
*
241
- * @param fieldPosition the field position from the the tuple start, starting from 0
242
+ * @param fieldPosition the field position from the tuple start, starting from 0
242
243
* @return value
243
244
*/
244
245
Character getCharacter (int fieldPosition );
@@ -254,7 +255,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
254
255
/**
255
256
* Get the field value converted to {@link UUID}
256
257
*
257
- * @param fieldPosition the field position from the the tuple start, starting from 0
258
+ * @param fieldPosition the field position from the tuple start, starting from 0
258
259
* @return value
259
260
*/
260
261
UUID getUUID (int fieldPosition );
@@ -267,10 +268,26 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
267
268
*/
268
269
UUID getUUID (String fieldName );
269
270
271
+ /**
272
+ * Get the field value converted to {@link Instant}
273
+ *
274
+ * @param fieldPosition the field position from the tuple start, starting from 0
275
+ * @return value
276
+ */
277
+ Instant getInstant (int fieldPosition );
278
+
279
+ /**
280
+ * Get the field value converted to {@link Instant}
281
+ *
282
+ * @param fieldName the field name, must not be null
283
+ * @return value
284
+ */
285
+ Instant getInstant (String fieldName );
286
+
270
287
/**
271
288
* Get the field value converted to {@link BigDecimal}
272
289
*
273
- * @param fieldPosition the field position from the the tuple start, starting from 0
290
+ * @param fieldPosition the field position from the tuple start, starting from 0
274
291
* @return value
275
292
*/
276
293
BigDecimal getDecimal (int fieldPosition );
@@ -286,7 +303,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
286
303
/**
287
304
* Get the field value converted to {@link List}
288
305
*
289
- * @param fieldPosition the field position from the the tuple start, starting from 0
306
+ * @param fieldPosition the field position from the tuple start, starting from 0
290
307
* @return value
291
308
*/
292
309
List <?> getList (int fieldPosition );
@@ -302,7 +319,7 @@ public interface TarantoolTuple extends Iterable<TarantoolField>, Packable {
302
319
/**
303
320
* Get the field value converted to {@link Map}
304
321
*
305
- * @param fieldPosition the field position from the the tuple start, starting from 0
322
+ * @param fieldPosition the field position from the tuple start, starting from 0
306
323
* @return value
307
324
*/
308
325
Map <?, ?> getMap (int fieldPosition );
0 commit comments