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

33 lines
563 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 User implements LiteFullJson {
@Getter private String id;
public User(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;
}
}