Skip to content

Commit

Permalink
Merge pull request #56 from AO-StreetArt/sceneApiUpdates
Browse files Browse the repository at this point in the history
Add active flag to scene object
  • Loading branch information
AO-StreetArt committed Mar 30, 2018
2 parents 4faadb5 + cef579b commit 3da87d9
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions src/main/java/adrestia/model/scene/Scene.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class Scene {
private String key;
private String name;
private String region;
private boolean active;
private double latitude;
private double longitude;
private double distance;
Expand All @@ -51,6 +52,7 @@ public Scene() {
this.key = "";
this.name = "";
this.region = "";
this.active = false;
}

/**
Expand All @@ -60,6 +62,34 @@ public Scene() {
* @param region A String Region for the Scene.
* @param latitude The latitude of the scene.
* @param longitude The longitude of the scene.
* @param active Is the scene active or not.
* @param distance The distance from the provided lat/long, used for queries.
* @param assets A String Array of Asset ID's associated to the scene.
* @param tags A String Array of Tags for the scene, used for queries.
* @param devices An Array of User Devices registered to the scene.
*/
public Scene(String key, String name, String region, double latitude,
double longitude, boolean active, double distance, String[] assets,
String[] tags, UserDevice[] devices) {
this.key = key;
this.name = name;
this.region = region;
this.latitude = latitude;
this.longitude = longitude;
this.distance = distance;
this.assets = assets;
this.tags = tags;
this.active = active;
this.deviceList = devices;
}

/**
* Partial Scene constructor.
* @param key A Unique String Key for the Scene.
* @param name A Name for the scene, by which it is externally identified.
* @param region A String Region for the Scene.
* @param latitude The latitude of the scene.
* @param longitude The longitude of the scene.
* @param distance The distance from the provided lat/long, used for queries.
* @param assets A String Array of Asset ID's associated to the scene.
* @param tags A String Array of Tags for the scene, used for queries.
Expand All @@ -76,6 +106,7 @@ public Scene(String key, String name, String region, double latitude,
this.distance = distance;
this.assets = assets;
this.tags = tags;
this.active = true;
this.deviceList = devices;
}

Expand All @@ -97,6 +128,24 @@ public void setKey(String newKey) {
this.key = newKey;
}

/**
* Set value of active.
* @param newActive A boolean value representing if the scene is active.
*/
@JsonSetter("active")
public void setActive(boolean newActive) {
this.active = newActive;
}

/**
* Returns value of active.
* @return True if the scene is active, otherwise false.
*/
@JsonGetter("active")
public boolean getActive() {
return this.active;
}

/**
* Returns value of name.
* @return The Name of the scene (external identifier).
Expand Down

0 comments on commit 3da87d9

Please sign in to comment.