2016-02-12 02:40:06 +01:00
|
|
|
package net.frozenorb.apiv3.model;
|
|
|
|
|
|
|
|
import lombok.Getter;
|
|
|
|
import lombok.ToString;
|
2016-02-12 06:31:57 +01:00
|
|
|
import net.frozenorb.apiv3.accessor.Punishments;
|
2016-02-12 02:40:06 +01:00
|
|
|
import org.bson.Document;
|
|
|
|
|
|
|
|
@ToString
|
2016-02-12 06:31:57 +01:00
|
|
|
public final class Punishment extends BaseModel {
|
2016-02-12 02:40:06 +01:00
|
|
|
|
|
|
|
@Getter private String id;
|
|
|
|
|
|
|
|
public Punishment(Document json) {
|
2016-02-12 06:31:57 +01:00
|
|
|
super(Punishments.COLLECTION_NAME);
|
|
|
|
|
2016-02-12 02:40:06 +01:00
|
|
|
this.id = json.getString("_id");
|
2016-02-12 06:31:57 +01:00
|
|
|
|
|
|
|
setId(id);
|
2016-02-12 02:40:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public Document toLiteJson() {
|
|
|
|
Document json = new Document();
|
|
|
|
|
|
|
|
json.put("_id", id);
|
|
|
|
|
|
|
|
return json;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Document toFullJson() {
|
|
|
|
Document json = toLiteJson();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return json;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|