package foundation.capacity.sight;
|
|
import foundation.data.entity.Entity;
|
import foundation.json.IJSONWriter;
|
|
public class SightAgent {
|
|
private Sight sight;
|
|
public SightAgent() {
|
|
}
|
|
public Sight newTarget() {
|
Sight result = new Sight();
|
|
if (sight == null) {
|
return result;
|
}
|
|
result.id = sight.id;
|
result.code = sight.code;
|
result.name = sight.name;
|
|
return result;
|
}
|
|
public Sight get() {
|
return sight;
|
}
|
|
public void set(Sight sight) {
|
this.sight = sight;
|
}
|
|
public void load(Entity entity) throws Exception {
|
if (sight == null) {
|
sight = new Sight();
|
}
|
|
sight.load(entity);
|
}
|
|
public String getId() {
|
if (sight == null) {
|
return null;
|
}
|
|
return sight.getId();
|
}
|
|
public String getCode() {
|
if (sight == null) {
|
return null;
|
}
|
|
return sight.getCode();
|
}
|
|
public void writeJSONBody(IJSONWriter writer) {
|
if (sight == null) {
|
writer.writeNull();
|
}
|
|
sight.writeJSONBody(writer);
|
}
|
|
}
|