// Path: app/src/main/java/de/dorianscholz/openlibre/model/AlgorithmUtil.java
// public static final DateFormat mFormatDateTime = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
// 
// Path: app/src/main/java/de/dorianscholz/openlibre/model/GlucoseData.java
// public static String formatValue(float value) {
//     return GLUCOSE_UNIT_IS_MMOL ?
//             new DecimalFormat("##.0").format(value) :
//             new DecimalFormat("###").format(value);
// }


import android.support.annotation.NonNull;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
import io.realm.RealmObject;
import io.realm.annotations.PrimaryKey;
import static de.dorianscholz.openlibre.model.AlgorithmUtil.mFormatDateTime;
import static de.dorianscholz.openlibre.model.GlucoseData.formatValue;
package de.dorianscholz.openlibre.model;





public class BloodGlucoseData extends RealmObject implements Comparable<BloodGlucoseData> {
    public static final String ID = "id";
    static final String GLUCOSE_LEVEL = "glucoseLevel";
    public static final String DATE = "date";
    public static final String TIMEZONE_OFFSET_IN_MINUTES = "timezoneOffsetInMinutes";

    @PrimaryKey
    private String id;
    private float glucoseLevel = -1; // in mg/dl
    private long date;
    private int timezoneOffsetInMinutes;

    public BloodGlucoseData() {}
    public BloodGlucoseData(long date, float glucoseLevel) {
        this.date = date;
        timezoneOffsetInMinutes = TimeZone.getDefault().getOffset(System.currentTimeMillis()) / 1000 / 60;
        this.glucoseLevel = glucoseLevel;
// Path: app/src/main/java/de/dorianscholz/openlibre/model/AlgorithmUtil.java
// public static final DateFormat mFormatDateTime = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
// 
// Path: app/src/main/java/de/dorianscholz/openlibre/model/GlucoseData.java
// public static String formatValue(float value) {
//     return GLUCOSE_UNIT_IS_MMOL ?
//             new DecimalFormat("##.0").format(value) :
//             new DecimalFormat("###").format(value);
// }


// Path: app/src/main/java/de/dorianscholz/openlibre/model/BloodGlucoseData.java
import android.support.annotation.NonNull;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
import io.realm.RealmObject;
import io.realm.annotations.PrimaryKey;
import static de.dorianscholz.openlibre.model.AlgorithmUtil.mFormatDateTime;
import static de.dorianscholz.openlibre.model.GlucoseData.formatValue;

package de.dorianscholz.openlibre.model;





public class BloodGlucoseData extends RealmObject implements Comparable<BloodGlucoseData> {
    public static final String ID = "id";
    static final String GLUCOSE_LEVEL = "glucoseLevel";
    public static final String DATE = "date";
    public static final String TIMEZONE_OFFSET_IN_MINUTES = "timezoneOffsetInMinutes";

    @PrimaryKey
    private String id;
    private float glucoseLevel = -1; // in mg/dl
    private long date;
    private int timezoneOffsetInMinutes;

    public BloodGlucoseData() {}
    public BloodGlucoseData(long date, float glucoseLevel) {
        this.date = date;
        timezoneOffsetInMinutes = TimeZone.getDefault().getOffset(System.currentTimeMillis()) / 1000 / 60;
        this.glucoseLevel = glucoseLevel;
        id = String.format(Locale.US, "blood_%s", mFormatDateTime.format(new Date(date)));