@@ -0,0 +1,2954 @@
+package com.getbase.android.db.cursors;%0A%0Aimport com.google.common.base.Function;%0A%0Aimport android.database.Cursor;%0A%0Apublic abstract class SingleRowTransforms %7B%0A  private SingleRowTransforms() %7B%0A  %7D%0A%0A  public static Builder getColumn(String columnName) %7B%0A    return new Builder(columnName);%0A  %7D%0A%0A  public static class Builder %7B%0A    private final String mColumnName;%0A%0A    Builder(String columnName) %7B%0A      mColumnName = columnName;%0A    %7D%0A%0A    public Function%3CCursor, String%3E asString() %7B%0A      return new CursorRowFunction%3CString%3E(mColumnName) %7B%0A        @Override%0A        protected String getValue(Cursor c, int columnIndex) %7B%0A          return c.getString(columnIndex);%0A        %7D%0A      %7D;%0A    %7D%0A%0A    public Function%3CCursor, Short%3E asShort() %7B%0A      return new CursorRowFunction%3CShort%3E(mColumnName) %7B%0A        @Override%0A        protected Short getValue(Cursor c, int columnIndex) %7B%0A          return c.getShort(columnIndex);%0A        %7D%0A      %7D;%0A    %7D%0A%0A    public Function%3CCursor, Integer%3E asInteger() %7B%0A      return new CursorRowFunction%3CInteger%3E(mColumnName) %7B%0A        @Override%0A        protected Integer getValue(Cursor c, int columnIndex) %7B%0A          return c.getInt(columnIndex);%0A        %7D%0A      %7D;%0A    %7D%0A%0A    public Function%3CCursor, Long%3E asLong() %7B%0A      return new CursorRowFunction%3CLong%3E(mColumnName) %7B%0A        @Override%0A        protected Long getValue(Cursor c, int columnIndex) %7B%0A          return c.getLong(columnIndex);%0A        %7D%0A      %7D;%0A    %7D%0A%0A    public Function%3CCursor, Float%3E asFloat() %7B%0A      return new CursorRowFunction%3CFloat%3E(mColumnName) %7B%0A        @Override%0A        protected Float getValue(Cursor c, int columnIndex) %7B%0A          return c.getFloat(columnIndex);%0A        %7D%0A      %7D;%0A    %7D%0A%0A    public Function%3CCursor, Double%3E asDouble() %7B%0A      return new CursorRowFunction%3CDouble%3E(mColumnName) %7B%0A        @Override%0A        protected Double getValue(Cursor c, int columnIndex) %7B%0A          return c.getDouble(columnIndex);%0A        %7D%0A      %7D;%0A    %7D%0A%0A    public Function%3CCursor, Boolean%3E asBoolean() %7B%0A      return new CursorRowFunction%3CBoolean%3E(mColumnName) %7B%0A        @Override%0A        protected Boolean getValue(Cursor c, int columnIndex) %7B%0A          return c.getInt(columnIndex) == 1;%0A        %7D%0A      %7D;%0A    %7D%0A  %7D%0A%0A  private abstract static class CursorRowFunction%3CT%3E implements Function%3CCursor, T%3E %7B%0A    protected final String mColumnName;%0A    private int mColumnIndex;%0A    private boolean mInitialized;%0A%0A    protected CursorRowFunction(String columnName) %7B%0A      mColumnName = columnName;%0A    %7D%0A%0A    private int getColumnIndex(Cursor c) %7B%0A      if (!mInitialized) %7B%0A        mColumnIndex = c.getColumnIndexOrThrow(mColumnName);%0A        mInitialized = true;%0A      %7D%0A%0A      return mColumnIndex;%0A    %7D%0A%0A    @Override%0A    public final T apply(Cursor c) %7B%0A      int index = getColumnIndex(c);%0A      return c.isNull(index)%0A          ? null%0A          : getValue(c, index);%0A    %7D%0A%0A    protected abstract T getValue(Cursor c, int columnIndex);%0A  %7D%0A%7D%0A

Add helper class for building functions for getting single column