public class TarantoolTupleImpl extends Object implements TarantoolTuple
Constructor and Description |
---|
TarantoolTupleImpl(org.msgpack.value.ArrayValue value,
MessagePackMapper mapper)
Construct an instance of
TarantoolTuple |
TarantoolTupleImpl(org.msgpack.value.ArrayValue value,
MessagePackMapper mapper,
TarantoolSpaceMetadata spaceMetadata)
Basic constructor.
|
TarantoolTupleImpl(Collection<?> values,
MessagePackMapper mapper)
Construct an instance of
TarantoolTuple from a list of objects |
TarantoolTupleImpl(Collection<?> values,
MessagePackMapper mapper,
TarantoolSpaceMetadata metadata)
Construct an instance of
TarantoolTuple from a list of objects. |
TarantoolTupleImpl(MessagePackMapper mapper)
Constructor for empty tuple
|
TarantoolTupleImpl(MessagePackMapper mapper,
TarantoolSpaceMetadata metadata)
Constructor for empty tuple with metadata
|
Modifier and Type | Method and Description |
---|---|
boolean |
canGetObject(int fieldPosition,
Class<?> objectClass)
Check if a tuple field exists and can be converted to the target value type
|
boolean |
canGetObject(String fieldName,
Class<?> objectClass)
Check if a tuple field exists and can be converted to the target value type
|
boolean |
equals(Object o) |
void |
forEach(Consumer<? super TarantoolField> action) |
Boolean |
getBoolean(int fieldPosition)
Get the field value converted to
Boolean |
Boolean |
getBoolean(String fieldName)
Get the field value converted to
Boolean |
byte[] |
getByteArray(int fieldPosition)
Get the field value converted to
byte[] |
byte[] |
getByteArray(String fieldName)
Get the field value converted to
byte[] |
Character |
getCharacter(int fieldPosition)
Get the field value converted to
Character |
Character |
getCharacter(String fieldName)
Get the field value converted to
Character |
BigDecimal |
getDecimal(int fieldPosition)
Get the field value converted to
BigDecimal |
BigDecimal |
getDecimal(String fieldName)
Get the field value converted to
BigDecimal |
Double |
getDouble(int fieldPosition)
Get the field value converted to
Double |
Double |
getDouble(String fieldName)
Get the field value converted to
Double |
Optional<TarantoolField> |
getField(int fieldPosition)
Get a tuple field by its position
|
Optional<TarantoolField> |
getField(String fieldName)
Get a tuple field by its name
|
protected int |
getFieldPositionByName(String fieldName) |
List<TarantoolField> |
getFields()
Get all tuple fields as list
|
Float |
getFloat(int fieldPosition)
Get the field value converted to
Float |
Float |
getFloat(String fieldName)
Get the field value converted to
Float |
Instant |
getInstant(int fieldPosition)
Get the field value converted to
Instant |
Instant |
getInstant(String fieldName)
Get the field value converted to
Instant |
Integer |
getInteger(int fieldPosition)
Get the field value converted to
Integer |
Integer |
getInteger(String fieldName)
Get the field value converted to
Integer |
Interval |
getInterval(int fieldPosition)
Get the field value converted to
Interval |
Interval |
getInterval(String fieldName)
Get the field value converted to
Interval |
List<?> |
getList(int fieldPosition)
Get the field value converted to
List |
List<?> |
getList(String fieldName)
Get the field value converted to
List |
Long |
getLong(int fieldPosition)
Get the field value converted to
Long |
Long |
getLong(String fieldName)
Get the field value converted to
Long |
Map<?,?> |
getMap(int fieldPosition)
Get the field value converted to
Map |
Map<?,?> |
getMap(String fieldName)
Get the field value converted to
Map |
Optional<?> |
getObject(int fieldPosition)
Get a tuple field value as a raw object
|
<O> Optional<O> |
getObject(int fieldPosition,
Class<O> objectClass)
Get a tuple field value by its position specifying the target value type
|
Optional<?> |
getObject(String fieldName)
Get a tuple field value as a raw object
|
<O> Optional<O> |
getObject(String fieldName,
Class<O> objectClass)
Get a tuple field value by its name specifying the target value type
|
String |
getString(int fieldPosition)
Get the field value converted to
String |
String |
getString(String fieldName)
Get the field value converted to
String |
UUID |
getUUID(int fieldPosition)
Get the field value converted to
UUID |
UUID |
getUUID(String fieldName)
Get the field value converted to
UUID |
int |
hashCode() |
boolean |
hasMetadata()
Check whether this tuple includes information about space format
|
Iterator<TarantoolField> |
iterator() |
void |
putObject(int fieldPosition,
Object value)
Set a tuple field value from an object by field position
|
void |
putObject(String fieldName,
Object value)
Set a tuple field value from an object by field name
|
void |
setField(int fieldPosition,
TarantoolField field)
Set a tuple field by field position
|
void |
setField(String fieldName,
TarantoolField field)
Set a tuple field by field name
|
int |
size()
Get the number of fields in this tuple
|
Spliterator<TarantoolField> |
spliterator() |
org.msgpack.value.Value |
toMessagePackValue(MessagePackObjectMapper mapper)
Convert this instance into a corresponding MessagePack
Value |
String |
toString() |
public TarantoolTupleImpl(MessagePackMapper mapper)
mapper
- provides conversion between MessagePack values and Java objectspublic TarantoolTupleImpl(MessagePackMapper mapper, TarantoolSpaceMetadata metadata)
mapper
- provides conversion between MessagePack values and Java objectsmetadata
- provides information about the target spacepublic TarantoolTupleImpl(Collection<?> values, MessagePackMapper mapper)
TarantoolTuple
from a list of objectsvalues
- list of tuple fields datamapper
- provides conversion between MessagePack values and Java objectspublic TarantoolTupleImpl(Collection<?> values, MessagePackMapper mapper, TarantoolSpaceMetadata metadata)
TarantoolTuple
from a list of objects. Provides space metadata which adds
extra functionality for working with fields and indexes.values
- list of tuple fields datamapper
- provides conversion between MessagePack values and Java objectsmetadata
- provides information about the target spacepublic TarantoolTupleImpl(org.msgpack.value.ArrayValue value, MessagePackMapper mapper)
TarantoolTuple
value
- serialized Tarantool tuplemapper
- provides conversion between MessagePack values and Java objectspublic TarantoolTupleImpl(org.msgpack.value.ArrayValue value, MessagePackMapper mapper, TarantoolSpaceMetadata spaceMetadata)
value
- serialized Tarantool tuplemapper
- provides conversion between MessagePack values and Java objectsspaceMetadata
- provides field names and other metadatapublic boolean hasMetadata()
TarantoolTuple
hasMetadata
in interface TarantoolTuple
public Optional<TarantoolField> getField(int fieldPosition)
TarantoolTuple
getField
in interface TarantoolTuple
fieldPosition
- the field position from the tuple start, starting from 0public Optional<TarantoolField> getField(String fieldName)
TarantoolTuple
getField
in interface TarantoolTuple
fieldName
- the field name in spacepublic List<TarantoolField> getFields()
TarantoolTuple
getFields
in interface TarantoolTuple
public <O> Optional<O> getObject(int fieldPosition, Class<O> objectClass)
TarantoolTuple
getObject
in interface TarantoolTuple
O
- target value typefieldPosition
- field position from the tuple start, starting from 0objectClass
- target value type classpublic boolean canGetObject(int fieldPosition, Class<?> objectClass)
TarantoolTuple
canGetObject
in interface TarantoolTuple
fieldPosition
- field position from the tuple start, starting from 0objectClass
- target value type classpublic <O> Optional<O> getObject(String fieldName, Class<O> objectClass)
TarantoolTuple
getObject
in interface TarantoolTuple
O
- target value typefieldName
- field name, should not be nullobjectClass
- target value type classpublic boolean canGetObject(String fieldName, Class<?> objectClass)
TarantoolTuple
canGetObject
in interface TarantoolTuple
fieldName
- field name, should not be nullobjectClass
- target value type classpublic Optional<?> getObject(int fieldPosition)
TarantoolTuple
getObject
in interface TarantoolTuple
fieldPosition
- field position from the tuple start, starting from 0public Optional<?> getObject(String fieldName)
TarantoolTuple
getObject
in interface TarantoolTuple
fieldName
- field name, should not be nullpublic Iterator<TarantoolField> iterator()
iterator
in interface Iterable<TarantoolField>
public void forEach(Consumer<? super TarantoolField> action)
forEach
in interface Iterable<TarantoolField>
public Spliterator<TarantoolField> spliterator()
spliterator
in interface Iterable<TarantoolField>
public org.msgpack.value.Value toMessagePackValue(MessagePackObjectMapper mapper)
Packable
Value
toMessagePackValue
in interface Packable
mapper
- configured Java objects to entities mapperpublic int size()
TarantoolTuple
size
in interface TarantoolTuple
public void setField(int fieldPosition, TarantoolField field)
TarantoolTuple
setField
in interface TarantoolTuple
fieldPosition
- the field position from the tuple start, starting from 0field
- new fieldpublic void setField(String fieldName, TarantoolField field)
TarantoolTuple
setField
in interface TarantoolTuple
fieldName
- the field name, must be not nullfield
- new fieldpublic void putObject(int fieldPosition, Object value)
TarantoolTuple
putObject
in interface TarantoolTuple
fieldPosition
- the field position from the tuple start, starting from 0value
- new field valuepublic void putObject(String fieldName, Object value)
TarantoolTuple
putObject
in interface TarantoolTuple
fieldName
- the field name, must not be nullvalue
- new field valuepublic byte[] getByteArray(int fieldPosition)
TarantoolTuple
byte[]
getByteArray
in interface TarantoolTuple
fieldPosition
- the field position from the tuple start, starting from 0public byte[] getByteArray(String fieldName)
TarantoolTuple
byte[]
getByteArray
in interface TarantoolTuple
fieldName
- the field name, must not be nullpublic Boolean getBoolean(int fieldPosition)
TarantoolTuple
Boolean
getBoolean
in interface TarantoolTuple
fieldPosition
- the field position from the tuple start, starting from 0public Boolean getBoolean(String fieldName)
TarantoolTuple
Boolean
getBoolean
in interface TarantoolTuple
fieldName
- the field name, must not be nullpublic Double getDouble(int fieldPosition)
TarantoolTuple
Double
getDouble
in interface TarantoolTuple
fieldPosition
- the field position from the tuple start, starting from 0public Double getDouble(String fieldName)
TarantoolTuple
Double
getDouble
in interface TarantoolTuple
fieldName
- the field name, must not be nullpublic Float getFloat(int fieldPosition)
TarantoolTuple
Float
getFloat
in interface TarantoolTuple
fieldPosition
- the field position from the tuple start, starting from 0public Float getFloat(String fieldName)
TarantoolTuple
Float
getFloat
in interface TarantoolTuple
fieldName
- the field name, must not be nullpublic Integer getInteger(int fieldPosition)
TarantoolTuple
Integer
getInteger
in interface TarantoolTuple
fieldPosition
- the field position from the tuple start, starting from 0public Integer getInteger(String fieldName)
TarantoolTuple
Integer
getInteger
in interface TarantoolTuple
fieldName
- the field name, must not be nullpublic Long getLong(int fieldPosition)
TarantoolTuple
Long
getLong
in interface TarantoolTuple
fieldPosition
- the field position from the tuple start, starting from 0public Long getLong(String fieldName)
TarantoolTuple
Long
getLong
in interface TarantoolTuple
fieldName
- the field name, must not be nullpublic String getString(int fieldPosition)
TarantoolTuple
String
getString
in interface TarantoolTuple
fieldPosition
- the field position from the tuple start, starting from 0public String getString(String fieldName)
TarantoolTuple
String
getString
in interface TarantoolTuple
fieldName
- the field name, must not be nullpublic Character getCharacter(int fieldPosition)
TarantoolTuple
Character
getCharacter
in interface TarantoolTuple
fieldPosition
- the field position from the tuple start, starting from 0public Character getCharacter(String fieldName)
TarantoolTuple
Character
getCharacter
in interface TarantoolTuple
fieldName
- the field name, must not be nullpublic UUID getUUID(int fieldPosition)
TarantoolTuple
UUID
getUUID
in interface TarantoolTuple
fieldPosition
- the field position from the tuple start, starting from 0public UUID getUUID(String fieldName)
TarantoolTuple
UUID
getUUID
in interface TarantoolTuple
fieldName
- the field name, must not be nullpublic Instant getInstant(int fieldPosition)
TarantoolTuple
Instant
getInstant
in interface TarantoolTuple
fieldPosition
- the field position from the tuple start, starting from 0public Instant getInstant(String fieldName)
TarantoolTuple
Instant
getInstant
in interface TarantoolTuple
fieldName
- the field name, must not be nullpublic Interval getInterval(int fieldPosition)
TarantoolTuple
Interval
getInterval
in interface TarantoolTuple
fieldPosition
- the field position from the tuple start, starting from 0public Interval getInterval(String fieldName)
TarantoolTuple
Interval
getInterval
in interface TarantoolTuple
fieldName
- the field name, must not be nullpublic BigDecimal getDecimal(int fieldPosition)
TarantoolTuple
BigDecimal
getDecimal
in interface TarantoolTuple
fieldPosition
- the field position from the tuple start, starting from 0public BigDecimal getDecimal(String fieldName)
TarantoolTuple
BigDecimal
getDecimal
in interface TarantoolTuple
fieldName
- the field name, must not be nullpublic List<?> getList(int fieldPosition)
TarantoolTuple
List
getList
in interface TarantoolTuple
fieldPosition
- the field position from the tuple start, starting from 0public List<?> getList(String fieldName)
TarantoolTuple
List
getList
in interface TarantoolTuple
fieldName
- the field name, must not be nullpublic Map<?,?> getMap(int fieldPosition)
TarantoolTuple
Map
getMap
in interface TarantoolTuple
fieldPosition
- the field position from the tuple start, starting from 0public Map<?,?> getMap(String fieldName)
TarantoolTuple
Map
getMap
in interface TarantoolTuple
fieldName
- the field name, must not be nullprotected int getFieldPositionByName(String fieldName)
Copyright © 2025 Picodata. All rights reserved.