package awesomefb.facebook;

import com.mongodb.BasicDBObject;
import org.bson.Document;
import org.json.JSONObject;

/**
 * Created by earl on 5/25/2015.
 */
public class User extends Entity {
    private String mName;
    private boolean mIsPage;

    /**
     * Saves user data into users collection,
     * returns DBObject with newly inserted id and some basic info (FB ID, name)
     * @param reference
     */
    public User(JSONObject reference) {
        super(reference);
        mName = reference.getString("name");
        mIsPage = reference.has("category");
    }

    public String getName() {
        return mName;
    }

    public boolean isPage() {
        return mIsPage;
    }

    public Document toDocument() {
        return new Document("fb_id", getFacebookId())
                .append("name", mName)
                .append("is_page", mIsPage)
                ;
    }
}

@@ -26,42 +26,8 @@
 k;%0A%0A
-import com.mongodb.BasicDBObject;%0A
 impo
@@ -213,175 +213,8 @@
 e;%0A%0A
-    /**%0A     * Saves user data into users collection,%0A     * returns DBObject with newly inserted id and some basic info (FB ID, name)%0A     * @param reference%0A     */%0A
     
@@ -364,32 +364,164 @@
 egory%22);%0A    %7D%0A%0A
+    public User(String id, String name, boolean isPage) %7B%0A        super(id);%0A        mName = name;%0A        mIsPage = isPage;%0A    %7D%0A%0A
     public Strin

Add constructor with id, name and is_page values