com.openfin.desktop.platform.PlatformSnapshot Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openfin-desktop-java-adapter Show documentation
Show all versions of openfin-desktop-java-adapter Show documentation
The Java API for OpenFin Runtime
package com.openfin.desktop.platform;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONObject;
import com.openfin.desktop.JsonBean;
import com.openfin.desktop.WindowOptions;
public class PlatformSnapshot extends JsonBean {
private List windows;
private PlatformSnapshotDetails snapshotDetails;
public PlatformSnapshot() {
super();
}
public PlatformSnapshot(JSONObject json) {
super(json);
this.getWindows();
this.getSnapshotDetails();
}
public List getWindows() {
if (this.windows == null && this.json.has("windows")) {
this.windows = this.getJsonBeanList("windows", WindowOptions.class);
}
return this.windows;
}
public void setWindows(WindowOptions ... windowOptions) {
this.windows = new ArrayList<>(windowOptions.length);
for (WindowOptions winOpt : windowOptions) {
this.windows.add(winOpt);
}
}
public void setWindows(List windows) {
this.windows = windows;
}
public PlatformSnapshotDetails getSnapshotDetails() {
if (this.snapshotDetails == null && json.has("snapshotDetails")) {
this.snapshotDetails = new PlatformSnapshotDetails(json.getJSONObject("snapshotDetails"));
}
return this.snapshotDetails;
}
@Override
public JSONObject getJson() {
this.setJsonArray("windows", this.windows);
this.setJsonBean("snapshotDetails", this.snapshotDetails);
return super.getJson();
}
}