package ge.edu.freeuni.sdp.iot.simulator.bath.model;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * Created by khrak on 6/25/16.
 */
@XmlRootElement
public class VentSwitch {
    @XmlElement
    private String status;
    @XmlElement
    private String houseid;

    public VentSwitch(String houseid) {
        this.houseid = houseid;
        status = "off";
    }

    public String getHouseid() {
        return houseid;
    }

    public String getStatus() {
        return status;
    }

    public void ventOn() {
        status = "on";
    }

    public void ventOff() {
        status = "off";
    }
}

@@ -47,16 +47,124 @@
 model;%0A%0A
+import com.fasterxml.jackson.annotation.JsonInclude;%0Aimport com.fasterxml.jackson.annotation.JsonProperty;%0A%0A
 import j
@@ -291,30 +291,57 @@
 6.%0A */%0A@
-XmlRootElement
+JsonInclude(JsonInclude.Include.NON_NULL)
 %0Apublic 
@@ -360,34 +360,46 @@
 itch %7B%0A    @
-XmlElement
+JsonProperty(%22status%22)
 %0A    private
@@ -418,23 +418,37 @@
 us;%0A
+%0A
     @
-XmlElement
+JsonProperty(%22houseid%22)
 %0A   

add json annotations to ventswitch