org.simpleflatmapper.datastax.impl.ResultSetEnumerable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sfm-datastax Show documentation
Show all versions of sfm-datastax Show documentation
Cassandra Datastax SFM supports.
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;
}
}