package io.trygvis.esper.testing.util.sql; import io.trygvis.esper.testing.*; import org.joda.time.*; import java.sql.*; import java.util.*; public class ResultSetF { public static final SqlF getInt = new SqlF() { public Integer apply(ResultSet rs) throws SQLException { return rs.getInt(1); } }; public static final SqlF getInteger = new SqlF() { public Integer apply(ResultSet rs) throws SQLException { int i = rs.getInt(1); return rs.wasNull() ? null : i; } }; public static final SqlF getDateTime = new SqlF() { public DateTime apply(ResultSet rs) throws SQLException { Timestamp i = rs.getTimestamp(1); return rs.wasNull() ? null : new DateTime(i.getTime()); } }; public static final SqlF getUUID = new SqlF() { public UUID apply(ResultSet rs) throws SQLException { return UUID.fromString(rs.getString(1)); } }; public static final SqlF getUuid = new SqlF() { public Uuid apply(ResultSet rs) throws SQLException { return Uuid.fromString(rs.getString(1)); } }; }