Skip to content

Commit c60e52b

Browse files
iDneprovArtDu
authored andcommitted
Update TarantoolTupleUsage
Update TarantoolTupleUsage according to our new documentation policy Closes #354
1 parent 1476c1e commit c60e52b

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

docs/TarantoolTupleUsage.md

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,8 @@
33
# TarantoolTuple usage
44

55
You can use TarantoolTuple for creating tuple which can be sent to the Tarantool instance
6-
or can be returned from default "crud" functions.
6+
or can be returned from default [tarantool/crud](https://github.com/tarantool/crud) or box methods.
77
You can create TarantoolTuple with this factory `TarantoolTupleFactory`.
88
See an example below:
99

10-
```java
11-
// Create a mapper factory
12-
DefaultMessagePackMapperFactory mapperFactory = DefaultMessagePackMapperFactory.getInstance();
13-
// Create a tuple factory
14-
TarantoolTupleFactory tupleFactory = new DefaultTarantoolTupleFactory(mapperFactory.defaultComplexTypesMapper());
15-
16-
// Create a tuple from listed values: [1,2.0,'3',4]
17-
TarantoolTuple tarantoolTuple = tupleFactory.create(1, 2.0, "3", new BigDecimal("4"));
18-
19-
Optional<?> object = tarantoolTuple.getObject(0);
20-
Optional<Integer> integer = tarantoolTuple.getObject(0, Integer.class);
21-
22-
// Returned value will have 'double' type (it is used by default).
23-
Optional<?> doubleValue = tarantoolTuple.getObject(1);
24-
// To get 'float' value we must explicitly define the target type.
25-
Optional<?> floatValue = tarantoolTuple.getObject(1, Float.class);
26-
27-
Optional<?> stringValue = tarantoolTuple.getObject(2);
28-
29-
Optional<?> bigDecimalValue = tarantoolTuple.getObject(3);
30-
```
10+
https://github.com/tarantool/cartridge-java/blob/c9c985955f02bdcd0729c515ba00eb0ad8301089/src/test/java/io/tarantool/driver/integration/ProxyTarantoolClientExampleIT.java#L115-L162

0 commit comments

Comments
 (0)