All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.simpleflatmapper.datastax.impl.ResultSetEnumerable Maven / Gradle / Ivy

There is a newer version: 8.2.3
Show newest version
package org.simpleflatmapper.datastax.impl;

import com.datastax.driver.core.ResultSet;
import com.datastax.driver.core.Row;
import org.simpleflatmapper.util.Enumerable;


public class ResultSetEnumerable implements Enumerable {
    private final ResultSet resultSet;
    private Row currentRow;

    public ResultSetEnumerable(ResultSet resultSet) {
        this.resultSet = resultSet;
    }

    @Override
    public boolean next() {
        if (resultSet.isExhausted()) return false;
        currentRow = resultSet.one();
        return true;
    }

    @Override
    public Row currentValue() {
        return currentRow;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy