thiagolocatelli / parse4j

Java Library to deal with Parse (parse.com) REST API
http://thiagolocatelli.github.io/parse4j
143 stars 117 forks source link

Add and AddUnique not implemented? #53

Open seuribe opened 8 years ago

seuribe commented 8 years ago

I need to add a ParseObject array to an object. With the Android API I use the ParseObject.addAll method:

    public ParseObject getParseObject() {
        ParseObject po = new ParseObject("CustomExercise");
        po.put("type", type.id);
        po.put("question", question);
        po.put("user", ParseUser.getCurrentUser());

        int index = 0;
        List<ParseObject> opts = new ArrayList<ParseObject>();
        for (String option : options) {
            ParseObject opo = new ParseObject("ExerciseOption");
            opo.put("text", option);
            opo.put("correct", index == correctIndex);
            opts.add(opo);
            index++;
        }
        po.addAll("options", opts);
        return po;
    }

which works well, but I get an "java.lang.IllegalArgumentException: not implemented!" exception when trying to use add or addAll in Parse4j. The documentations mentions addAllUnique, but it's also not implemented. Is there an alternative way of doing it?