package it.danieleverducci.openweddingapp.entities

import android.util.Log
import org.json.JSONException
import org.json.JSONObject

/*
 JSON Example:
    {
        "willBePresent": true
    }
 */

class Presence: Jsonable {
    val willBePresent: Boolean
    val notes: String

    @Throws(JSONException::class)
    constructor(willBePresent: Boolean, notes: String) {
        this.willBePresent = willBePresent
        this.notes = notes
    }

    @Throws(JSONException::class)
    constructor(locJo: JSONObject) {
        willBePresent = locJo.getBoolean("willBePresent")
        notes = locJo.getString("notes")
    }

    override fun toJson(): JSONObject {
        val jo = JSONObject()
        jo.put("willBePresent", willBePresent)
        jo.put("notes", notes)
        return jo
    }

}