APIv3/src/main/java/net/frozenorb/apiv3/model/User.java
2016-02-12 00:31:57 -05:00

37 lines
618 B
Java

package net.frozenorb.apiv3.model;
import lombok.Getter;
import lombok.ToString;
import net.frozenorb.apiv3.accessor.Users;
import org.bson.Document;
@ToString
public final class User extends BaseModel {
@Getter private String id;
public User(Document json) {
super(Users.COLLECTION_NAME);
this.id = json.getString("_id");
setId(id);
}
public Document toLiteJson() {
Document json = new Document();
json.put("_id", id);
return json;
}
public Document toFullJson() {
Document json = toLiteJson();
return json;
}
}