io.tarantool.driver.core.metadata.CRUDResponseToTarantoolSpaceMetadataConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cartridge-driver Show documentation
Show all versions of cartridge-driver Show documentation
Tarantool Cartridge driver for Tarantool versions 1.10+ based on Netty framework
package io.tarantool.driver.core.metadata;
import io.tarantool.driver.api.metadata.TarantoolSpaceMetadata;
import io.tarantool.driver.mappers.converters.ValueConverter;
import org.msgpack.value.ArrayValue;
/**
* Populates crud response metadata format to {@link TarantoolSpaceMetadata}.
* The input data must be consistent with the metadata format from tarantool/crud.
* See
*
* https://github.com/tarantool/crud#api
*
*
* @author Artyom Dubinin
*/
public final class CRUDResponseToTarantoolSpaceMetadataConverter
implements ValueConverter {
private static final CRUDResponseToTarantoolSpaceMetadataConverter instance =
new CRUDResponseToTarantoolSpaceMetadataConverter();
private static final ArrayValueToSpaceFormatConverter arrayValueToSpaceFormatConverter
= ArrayValueToSpaceFormatConverter.getInstance();
private CRUDResponseToTarantoolSpaceMetadataConverter() {
}
public TarantoolSpaceMetadata fromValue(ArrayValue metadata) {
TarantoolSpaceMetadataImpl spaceMetadata = new TarantoolSpaceMetadataImpl();
spaceMetadata.setSpaceFormatMetadata(arrayValueToSpaceFormatConverter.fromValue(metadata));
return spaceMetadata;
}
public static CRUDResponseToTarantoolSpaceMetadataConverter getInstance() {
return instance;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy