net.sjr.sql.rsloader.Java8RsLoader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java8-rs-loader Show documentation
Show all versions of java8-rs-loader Show documentation
The RsLoader for Java 8 Time API
package net.sjr.sql.rsloader;
import net.sjr.converterutils.Java8ConverterUtils;
import net.sjr.sql.DAOBase;
import net.sjr.sql.DBColumn;
import net.sjr.sql.DBEnum;
import net.sjr.sql.DBObject;
import java.math.BigDecimal;
import java.sql.Date;
import java.sql.ResultSet;
import java.sql.Time;
import java.sql.Timestamp;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.function.Consumer;
import java.util.function.Supplier;
/**
* Created by Jan Reichl on 18.08.17.
*/
@SuppressWarnings({"unused", "WeakerAccess"})
public class Java8RsLoader extends RsLoader {
@Override
public Java8RsLoader skip() {
return (Java8RsLoader) super.skip();
}
@Override
public Java8RsLoader skip(final int steps) {
return (Java8RsLoader) super.skip(steps);
}
public Java8RsLoader skip(Supplier getter, Consumer setter) {
setter.accept(getter.get());
return skip();
}
public Java8RsLoader skip(Supplier getter, Consumer setter, final int steps) {
setter.accept(getter.get());
return skip(steps);
}
public Java8RsLoader(final ResultSet rs, final DBObject... loadedObjects) {
super(rs, loadedObjects);
}
public Java8RsLoader nextString(Consumer setter) {
setter.accept(nextString());
return this;
}
public Java8RsLoader nextBoolean(Consumer setter) {
setter.accept(nextBoolean());
return this;
}
public Java8RsLoader nextNullBoolean(Consumer setter) {
setter.accept(nextBoolean());
return this;
}
public Java8RsLoader nextByte(Consumer setter) {
setter.accept(nextByte());
return this;
}
public Java8RsLoader nextNullByte(Consumer setter) {
setter.accept(nextByte());
return this;
}
public Java8RsLoader nextShort(Consumer setter) {
setter.accept(nextShort());
return this;
}
public Java8RsLoader nextNullShort(Consumer setter) {
setter.accept(nextShort());
return this;
}
public Java8RsLoader nextInt(Consumer setter) {
setter.accept(nextInt());
return this;
}
public Java8RsLoader nextNullInt(Consumer setter) {
setter.accept(nextInt());
return this;
}
public Java8RsLoader nextLong(Consumer setter) {
setter.accept(nextLong());
return this;
}
public Java8RsLoader nextNullLong(Consumer setter) {
setter.accept(nextLong());
return this;
}
public Java8RsLoader nextFloat(Consumer setter) {
setter.accept(nextFloat());
return this;
}
public Java8RsLoader nextNullFloat(Consumer setter) {
setter.accept(nextFloat());
return this;
}
public Java8RsLoader nextDouble(Consumer setter) {
setter.accept(nextDouble());
return this;
}
public Java8RsLoader nextNullDouble(Consumer setter) {
setter.accept(nextDouble());
return this;
}
public Java8RsLoader nextBigDecimal(Consumer setter) {
setter.accept(nextBigDecimal());
return this;
}
public Java8RsLoader nextDate(Consumer setter) {
setter.accept(nextDate());
return this;
}
public Java8RsLoader nextTime(Consumer