Code example for Field

Methods: getInt, setInt

0
        newState[0] = Character.toUpperCase(newState[0]);
        StringBuilder attr = new StringBuilder();
		attr.append("m").append(String.valueOf(newState)).append(String.format("Ease%d", ease));
        try { 
            Field f = stats.getClass().getDeclaredField(attr.toString());
            f.setInt(stats, f.getInt(stats) + 1);
        } catch (Exception e) {
            log.error("Failed to update " + attr.toString() + " : " + e.getMessage());
        } 
        stats.toDB(oldValues);
    } 
 
 
    public JSONObject bundleJson() {
        JSONObject bundledStat = new JSONObject();
 
        try { 
            bundledStat.put("type", mType);
            bundledStat.put("day", Utils.dateToOrdinal(mDay));
            bundledStat.put("reps", mReps);
            bundledStat.put("averageTime", mAverageTime);