Interface TarantoolTuple

    • Method Detail

      • getField

        Optional<TarantoolField> getField​(int fieldPosition)
        Get a tuple field by its position
        Parameters:
        fieldPosition - the field position from the the tuple start, starting from 0
        Returns:
        field or empty optional if the field position is out of tuple length
      • getField

        Optional<TarantoolField> getField​(String fieldName)
        Get a tuple field by its name
        Parameters:
        fieldName - the field name in space
        Returns:
        field or empty optional if the field not exist in space
      • getFields

        List<TarantoolField> getFields()
        Get all tuple fields as list
        Returns:
        all tuple fields as list
      • getObject

        <O> Optional<O> getObject​(int fieldPosition,
                                  Class<O> objectClass)
        Get a tuple field value by its position specifying the target value type
        Type Parameters:
        O - target value type
        Parameters:
        fieldPosition - field position from the the tuple start, starting from 0
        objectClass - target value type class
        Returns:
        nullable value of a field wrapped in Optional, possibly converted to a Java type
      • canGetObject

        boolean canGetObject​(int fieldPosition,
                             Class<?> objectClass)
        Check if a tuple field exists and can be converted to the target value type
        Parameters:
        fieldPosition - field position from the the tuple start, starting from 0
        objectClass - target value type class
        Returns:
        true, if the field exists and can be converted to the given type, false otherwise
      • getObject

        <O> Optional<O> getObject​(String fieldName,
                                  Class<O> objectClass)
        Get a tuple field value by its name specifying the target value type
        Type Parameters:
        O - target value type
        Parameters:
        fieldName - field name, should not be null
        objectClass - target value type class
        Returns:
        nullable value of a field wrapped in Optional, possibly converted to a Java type
      • canGetObject

        boolean canGetObject​(String fieldName,
                             Class<?> objectClass)
        Check if a tuple field exists and can be converted to the target value type
        Parameters:
        fieldName - field name, should not be null
        objectClass - target value type class
        Returns:
        true, if the field exists and can be converted to the given type, false otherwise
      • getObject

        Optional<?> getObject​(int fieldPosition)
        Get a tuple field value as a raw object
        Parameters:
        fieldPosition - field position from the the tuple start, starting from 0
        Returns:
        nullable value of a field wrapped in Optional
      • getObject

        Optional<?> getObject​(String fieldName)
        Get a tuple field value as a raw object
        Parameters:
        fieldName - field name, should not be null
        Returns:
        nullable value of a field wrapped in Optional
      • size

        int size()
        Get the number of fields in this tuple
        Returns:
        the number of fields in this tuple
      • setField

        void setField​(int fieldPosition,
                      TarantoolField field)
        Set a tuple field by field position
        Parameters:
        fieldPosition - the field position from the the tuple start, starting from 0
        field - new field
      • setField

        void setField​(String fieldName,
                      TarantoolField field)
        Set a tuple field by field name
        Parameters:
        fieldName - the field name, must be not null
        field - new field
      • putObject

        void putObject​(int fieldPosition,
                       Object value)
        Set a tuple field value from an object by field position
        Parameters:
        fieldPosition - the field position from the the tuple start, starting from 0
        value - new field value
      • putObject

        void putObject​(String fieldName,
                       Object value)
        Set a tuple field value from an object by field name
        Parameters:
        fieldName - the field name, must not be null
        value - new field value
      • getByteArray

        byte[] getByteArray​(int fieldPosition)
        Get the field value converted to byte[]
        Parameters:
        fieldPosition - the field position from the the tuple start, starting from 0
        Returns:
        value
      • getByteArray

        byte[] getByteArray​(String fieldName)
        Get the field value converted to byte[]
        Parameters:
        fieldName - the field name, must not be null
        Returns:
        value
      • getBoolean

        Boolean getBoolean​(int fieldPosition)
        Get the field value converted to Boolean
        Parameters:
        fieldPosition - the field position from the the tuple start, starting from 0
        Returns:
        value
      • getBoolean

        Boolean getBoolean​(String fieldName)
        Get the field value converted to Boolean
        Parameters:
        fieldName - the field name, must not be null
        Returns:
        value
      • getDouble

        Double getDouble​(int fieldPosition)
        Get the field value converted to Double
        Parameters:
        fieldPosition - the field position from the the tuple start, starting from 0
        Returns:
        value
      • getDouble

        Double getDouble​(String fieldName)
        Get the field value converted to Double
        Parameters:
        fieldName - the field name, must not be null
        Returns:
        value
      • getFloat

        Float getFloat​(int fieldPosition)
        Get the field value converted to Float
        Parameters:
        fieldPosition - the field position from the the tuple start, starting from 0
        Returns:
        value
      • getFloat

        Float getFloat​(String fieldName)
        Get the field value converted to Float
        Parameters:
        fieldName - the field name, must not be null
        Returns:
        value
      • getInteger

        Integer getInteger​(int fieldPosition)
        Get the field value converted to Integer
        Parameters:
        fieldPosition - the field position from the the tuple start, starting from 0
        Returns:
        value
      • getInteger

        Integer getInteger​(String fieldName)
        Get the field value converted to Integer
        Parameters:
        fieldName - the field name, must not be null
        Returns:
        value
      • getLong

        Long getLong​(int fieldPosition)
        Get the field value converted to Long
        Parameters:
        fieldPosition - the field position from the the tuple start, starting from 0
        Returns:
        value
      • getLong

        Long getLong​(String fieldName)
        Get the field value converted to Long
        Parameters:
        fieldName - the field name, must not be null
        Returns:
        value
      • getString

        String getString​(int fieldPosition)
        Get the field value converted to String
        Parameters:
        fieldPosition - the field position from the the tuple start, starting from 0
        Returns:
        value
      • getString

        String getString​(String fieldName)
        Get the field value converted to String
        Parameters:
        fieldName - the field name, must not be null
        Returns:
        value
      • getCharacter

        Character getCharacter​(int fieldPosition)
        Get the field value converted to Character
        Parameters:
        fieldPosition - the field position from the the tuple start, starting from 0
        Returns:
        value
      • getCharacter

        Character getCharacter​(String fieldName)
        Get the field value converted to Character
        Parameters:
        fieldName - the field name, must not be null
        Returns:
        value
      • getUUID

        UUID getUUID​(int fieldPosition)
        Get the field value converted to UUID
        Parameters:
        fieldPosition - the field position from the the tuple start, starting from 0
        Returns:
        value
      • getUUID

        UUID getUUID​(String fieldName)
        Get the field value converted to UUID
        Parameters:
        fieldName - the field name, must not be null
        Returns:
        value
      • getDecimal

        BigDecimal getDecimal​(int fieldPosition)
        Get the field value converted to BigDecimal
        Parameters:
        fieldPosition - the field position from the the tuple start, starting from 0
        Returns:
        value
      • getDecimal

        BigDecimal getDecimal​(String fieldName)
        Get the field value converted to BigDecimal
        Parameters:
        fieldName - the field name, must not be null
        Returns:
        value
      • getList

        List<?> getList​(int fieldPosition)
        Get the field value converted to List
        Parameters:
        fieldPosition - the field position from the the tuple start, starting from 0
        Returns:
        value
      • getList

        List<?> getList​(String fieldName)
        Get the field value converted to List
        Parameters:
        fieldName - the field name, must not be null
        Returns:
        value
      • getMap

        Map<?,​?> getMap​(int fieldPosition)
        Get the field value converted to Map
        Parameters:
        fieldPosition - the field position from the the tuple start, starting from 0
        Returns:
        value
      • getMap

        Map<?,​?> getMap​(String fieldName)
        Get the field value converted to Map
        Parameters:
        fieldName - the field name, must not be null
        Returns:
        value