@Test public void addRole() throws Exception { NCMBRole role1 = new NCMBRole("testRole1"); role1.setObjectId("dummyRoleObjectId1"); NCMBRole role2 = new NCMBRole("testRole2"); role2.setObjectId("dummyRoleObjectId2"); NCMBRole role = new NCMBRole("testRole"); role.setObjectId("dummyRoleId"); role.addRole(Arrays.asList(role1, role2)); SimpleDateFormat df = NCMBDateFormat.getIso8601(); Assert.assertEquals(df.parse("2014-06-04T11:28:30.348Z"), role.getUpdateDate()); }
public void addRole(List<NCMBRole> roles) throws NCMBException { NCMBRoleService roleService = (NCMBRoleService) NCMB.factory(NCMB.ServiceType.ROLE); try { JSONObject res = roleService.addRoleRelations(getObjectId(), roles); mFields.put("updateDate", res.getString("updateDate")); } catch (NCMBException e) { throw e; } catch (JSONException e) { throw new NCMBException(NCMBException.INVALID_JSON, e.getMessage()); } }
NCMBRole extends NCMBBase { public void addRole(List<NCMBRole> roles) throws NCMBException { NCMBRoleService roleService = (NCMBRoleService) NCMB.factory(NCMB.ServiceType.ROLE); try { JSONObject res = roleService.addRoleRelations(getObjectId(), roles); mFields.put("updateDate", res.getString("updateDate")); } catch (NCMBException e) { throw e; } catch (JSONException e) { throw new NCMBException(NCMBException.INVALID_JSON, e.getMessage()); } } }
NCMBRole extends NCMBBase { public void addRole(List<NCMBRole> roles) throws NCMBException { NCMBRoleService roleService = (NCMBRoleService) NCMB.factory(NCMB.ServiceType.ROLE); try { JSONObject res = roleService.addRoleRelations(getObjectId(), roles); mFields.put("updateDate", res.getString("updateDate")); } catch (NCMBException e) { throw e; } catch (JSONException e) { throw new NCMBException(NCMBException.INVALID_JSON, e.getMessage()); } } NCMBRole();  NCMBRole(String name);   NCMBRole(JSONObject params); }
NCMBRole extends NCMBBase { public void addRole(List<NCMBRole> roles) throws NCMBException { NCMBRoleService roleService = (NCMBRoleService) NCMB.factory(NCMB.ServiceType.ROLE); try { JSONObject res = roleService.addRoleRelations(getObjectId(), roles); mFields.put("updateDate", res.getString("updateDate")); } catch (NCMBException e) { throw e; } catch (JSONException e) { throw new NCMBException(NCMBException.INVALID_JSON, e.getMessage()); } } NCMBRole();  NCMBRole(String name);   NCMBRole(JSONObject params); static NCMBQuery<NCMBRole> getQuery(); String getRoleName(); void setRoleName(String name); void addUser(List<NCMBUser> users); void addUserInBackground(List<NCMBUser> users, final DoneCallback callback); void removeUser(List<NCMBUser> users); void removeUserInBackground(List<NCMBUser> users, final DoneCallback callback); void addRole(List<NCMBRole> roles); void addRoleInBackground(List<NCMBRole> roles, final DoneCallback callback); void removeRole(List<NCMBRole> roles); void removeRoleInBackground(List<NCMBRole> roles, final DoneCallback callback); void createRole(); void createRoleInBackground(final DoneCallback callback); void fetchObject(); void fetchObjectInBackground(final FetchCallback callback); void deleteObject(); void deleteObjectInBackground(final DoneCallback callback); }
NCMBRole extends NCMBBase { public void addRole(List<NCMBRole> roles) throws NCMBException { NCMBRoleService roleService = (NCMBRoleService) NCMB.factory(NCMB.ServiceType.ROLE); try { JSONObject res = roleService.addRoleRelations(getObjectId(), roles); mFields.put("updateDate", res.getString("updateDate")); } catch (NCMBException e) { throw e; } catch (JSONException e) { throw new NCMBException(NCMBException.INVALID_JSON, e.getMessage()); } } NCMBRole();  NCMBRole(String name);   NCMBRole(JSONObject params); static NCMBQuery<NCMBRole> getQuery(); String getRoleName(); void setRoleName(String name); void addUser(List<NCMBUser> users); void addUserInBackground(List<NCMBUser> users, final DoneCallback callback); void removeUser(List<NCMBUser> users); void removeUserInBackground(List<NCMBUser> users, final DoneCallback callback); void addRole(List<NCMBRole> roles); void addRoleInBackground(List<NCMBRole> roles, final DoneCallback callback); void removeRole(List<NCMBRole> roles); void removeRoleInBackground(List<NCMBRole> roles, final DoneCallback callback); void createRole(); void createRoleInBackground(final DoneCallback callback); void fetchObject(); void fetchObjectInBackground(final FetchCallback callback); void deleteObject(); void deleteObjectInBackground(final DoneCallback callback);  }