@Test(expected = IllegalArgumentException.class) public void testPutFailureWithInvalidNameTypeSet() { ParseRole role = new ParseRole("Test"); role.put("name", 1); }
@Override public void put(@NonNull String key, @NonNull Object value) { if ("name".equals(key)) { if (this.getObjectId() != null) { throw new IllegalArgumentException( "A role's name can only be set before it has been saved."); } if (!(value instanceof String)) { throw new IllegalArgumentException("A role's name must be a String."); } if (!NAME_PATTERN.matcher((String) value).matches()) { throw new IllegalArgumentException( "A role's name can only contain alphanumeric characters, _, -, and spaces."); } } super.put(key, value); }
ParseRole extends ParseObject { @Override public void put(@NonNull String key, @NonNull Object value) { if ("name".equals(key)) { if (this.getObjectId() != null) { throw new IllegalArgumentException( "A role's name can only be set before it has been saved."); } if (!(value instanceof String)) { throw new IllegalArgumentException("A role's name must be a String."); } if (!NAME_PATTERN.matcher((String) value).matches()) { throw new IllegalArgumentException( "A role's name can only contain alphanumeric characters, _, -, and spaces."); } } super.put(key, value); } }
ParseRole extends ParseObject { @Override public void put(@NonNull String key, @NonNull Object value) { if ("name".equals(key)) { if (this.getObjectId() != null) { throw new IllegalArgumentException( "A role's name can only be set before it has been saved."); } if (!(value instanceof String)) { throw new IllegalArgumentException("A role's name must be a String."); } if (!NAME_PATTERN.matcher((String) value).matches()) { throw new IllegalArgumentException( "A role's name can only contain alphanumeric characters, _, -, and spaces."); } } super.put(key, value); } ParseRole();  ParseRole(String name);  ParseRole(String name, ParseACL acl); }
ParseRole extends ParseObject { @Override public void put(@NonNull String key, @NonNull Object value) { if ("name".equals(key)) { if (this.getObjectId() != null) { throw new IllegalArgumentException( "A role's name can only be set before it has been saved."); } if (!(value instanceof String)) { throw new IllegalArgumentException("A role's name must be a String."); } if (!NAME_PATTERN.matcher((String) value).matches()) { throw new IllegalArgumentException( "A role's name can only contain alphanumeric characters, _, -, and spaces."); } } super.put(key, value); } ParseRole();  ParseRole(String name);  ParseRole(String name, ParseACL acl); static ParseQuery<ParseRole> getQuery(); String getName(); void setName(String name); ParseRelation<ParseUser> getUsers(); ParseRelation<ParseRole> getRoles(); @Override void put(@NonNull String key, @NonNull Object value); }
ParseRole extends ParseObject { @Override public void put(@NonNull String key, @NonNull Object value) { if ("name".equals(key)) { if (this.getObjectId() != null) { throw new IllegalArgumentException( "A role's name can only be set before it has been saved."); } if (!(value instanceof String)) { throw new IllegalArgumentException("A role's name must be a String."); } if (!NAME_PATTERN.matcher((String) value).matches()) { throw new IllegalArgumentException( "A role's name can only contain alphanumeric characters, _, -, and spaces."); } } super.put(key, value); } ParseRole();  ParseRole(String name);  ParseRole(String name, ParseACL acl); static ParseQuery<ParseRole> getQuery(); String getName(); void setName(String name); ParseRelation<ParseUser> getUsers(); ParseRelation<ParseRole> getRoles(); @Override void put(@NonNull String key, @NonNull Object value);  }