package foundation.page;
|
|
import foundation.data.entity.Entity;
|
import foundation.json.IJSONProvider;
|
import foundation.json.IJSONWriter;
|
|
public class Tab implements IJSONProvider {
|
|
private String id;
|
private String code;
|
private String name;
|
private String title;
|
private String url;
|
private boolean active;
|
|
public Tab() {
|
|
}
|
|
public void load(Entity entity) {
|
id = entity.getString("id");
|
code = entity.getString("code");
|
name = entity.getString("name");
|
title = entity.getString("title");
|
url = entity.getString("url");
|
active = entity.getBoolean("is_active", true);
|
}
|
|
public String getId() {
|
return id;
|
}
|
|
public String getName() {
|
return name;
|
}
|
|
public String getCode() {
|
return code;
|
}
|
|
public String getTitle() {
|
return title;
|
}
|
|
public String getUrl() {
|
return url;
|
}
|
|
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("name", name);
|
writer.write("title", title);
|
writer.write("url", url);
|
}
|
|
|
}
|