com.scalar.db.sql.common.EmptyResultSet Maven / Gradle / Ivy
package com.scalar.db.sql.common;
import com.scalar.db.sql.ColumnDefinitions;
import com.scalar.db.sql.Record;
import com.scalar.db.sql.ResultSet;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nonnull;
public enum EmptyResultSet implements ResultSet {
INSTANCE;
@Override
public Optional one() {
return Optional.empty();
}
@Override
public List all() {
return Collections.emptyList();
}
@Override
public ColumnDefinitions getColumnDefinitions() {
return EmptyColumnDefinitions.INSTANCE;
}
@Nonnull
@Override
public Iterator iterator() {
return Collections.emptyIterator();
}
}