package com.rthoni.camotion.dbo;

import com.luticate.utils.dbo.LuDbo;

import org.json.JSONException;
import org.json.JSONObject;

import java.util.HashMap;

/**
 * Created by robin on 12/4/15.
 */
public class SensorValueDbo extends LuDbo {

    private int _value;

    public int getValue() {
        return _value;
    }

    public void setValue(int value) {
        _value = value;
    }

    @Override
    public void fromJson(JSONObject json) throws JSONException {
        _value = json.getInt("Value");
    }

    @Override
    public HashMap<String, Object> toArray() {
        HashMap<String, Object> array = new HashMap<>();
        array.put("Value", _value);
        return array;
    }
}
