package foundation.page;
|
|
import foundation.data.entity.Entity;
|
import foundation.json.IJSONProvider;
|
import foundation.json.IJSONWriter;
|
|
public class Button implements IJSONProvider {
|
|
private String id;
|
private String code;
|
private String title;
|
private String tabId;
|
private boolean active;
|
|
public Button() {
|
|
}
|
|
public void load(Entity entity) {
|
id = entity.getString("id");
|
code = entity.getString("code");
|
title = entity.getString("title");
|
tabId = entity.getString("tab_id");
|
active = entity.getBoolean("is_active", true);
|
}
|
|
public String getId() {
|
return id;
|
}
|
|
public String getCode() {
|
return code;
|
}
|
|
public String getTitle() {
|
return title;
|
}
|
|
public String getTabId() {
|
return tabId;
|
}
|
|
public boolean isActive() {
|
return active;
|
}
|
|
@Override
|
public void writeJSON(IJSONWriter writer) {
|
writer.beginObject();
|
writeJSONBody(writer);
|
writer.endObject();
|
}
|
|
public void writeJSONBody(IJSONWriter writer) {
|
writer.write("id", id);
|
writer.write("code", code);
|
writer.write("title", title);
|
writer.write("tab_id", tabId);
|
}
|
|
}
|