APIv3/src/main/java/net/frozenorb/apiv3/model/Punishment.java

33 lines
575 B
Java
Raw Normal View History

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