/** * Update the value at the provided path. Equivalent to using the * {@link JsonUtils#replaceValue(Path, ObjectNode, JsonNode)} method: * JsonUtils.replaceValues(Path.fromString(path), getObjectNode(), value). * <p> * * The {@link JsonUtils#valueToNode(Object)} method may be used to convert * the given value instance to a JSON node. * <p> * * @param path The path to the attribute whose value to set. * @param value The value(s) to set. * @return This object. * @throws ScimException thrown if an error occurs (for example * if the path or value is "{@code null}" or invalid). */ public GenericScimResource replaceValue(final String path, final JsonNode value) throws ScimException { replaceValue(Path.fromString(path), value); return this; }
/** * Update the value at the provided path. Equivalent to using the * {@link JsonUtils#replaceValue(Path, ObjectNode, JsonNode)} method: * JsonUtils.replaceValues(Path.fromString(path), getObjectNode(), value). * <p> * * The {@link JsonUtils#valueToNode(Object)} method may be used to convert * the given value instance to a JSON node. * <p> * * @param path The path to the attribute whose value to set. * @param value The value(s) to set. * @return This object. * @throws ScimException thrown if an error occurs (for example * if the path or value is "{@code null}" or invalid). */ public GenericScimResource replaceValue(final String path, final JsonNode value) throws ScimException { replaceValue(Path.fromString(path), value); return this; }
final Integer value) throws ScimException return replaceValue(Path.fromString(path), value);
final Double value) throws ScimException return replaceValue(Path.fromString(path), value);
final Boolean value) throws ScimException return replaceValue(Path.fromString(path), value);
final String value) throws ScimException return replaceValue(Path.fromString(path), value);
final Boolean value) throws ScimException return replaceValue(Path.fromString(path), value);
final String path, final Date value) throws ScimException return replaceValue(Path.fromString(path), value);
final String path, final Long value) throws ScimException return replaceValue(Path.fromString(path), value);
final String path, final byte[] value) throws ScimException return replaceValue(Path.fromString(path), value);
throws ScimException return replaceValue(path, JsonUtils.getJsonNodeFactory().textNode(value.toString()));
final Path path, final byte[] value) throws ScimException return replaceValue(path, JsonUtils.getJsonNodeFactory().binaryNode(value));
final Path path, final Long value) throws ScimException return replaceValue(path, JsonUtils.getJsonNodeFactory().numberNode(value));
final Path path, final byte[] value) throws ScimException return replaceValue(path, JsonUtils.getJsonNodeFactory().binaryNode(value));
final Path path, final Boolean value) throws ScimException return replaceValue(path, JsonUtils.getJsonNodeFactory().booleanNode(value));
final String value) throws ScimException return replaceValue(path, JsonUtils.getJsonNodeFactory().textNode(value));
final Path path, final Long value) throws ScimException return replaceValue(path, JsonUtils.getJsonNodeFactory().numberNode(value));
Assert.assertEquals(gsr.replaceValue(path1, value1). getLongValue(Path.fromString(path1)), value1); Assert.assertEquals(gsr.replaceValue(Path.fromString(path2), value2). getLongValue(path2), value2);
Assert.assertEquals(gsr.replaceValue(path1, value1). getStringValue(Path.fromString(path1)), value1); Assert.assertEquals(gsr.replaceValue(Path.fromString(path2), value2). getStringValue(path2), value2);
Assert.assertEquals(gsr.replaceValue(path1, value1). getBooleanValue(Path.fromString(path1)), value1); Assert.assertEquals(gsr.replaceValue(Path.fromString(path2), value2). getBooleanValue(path2), value2);