public final class SetCustomField extends SetCustomFieldBase<Review>
See also ReviewUpdateCommand.
withUpdateableType(client(), type -> { withUpdateableReview(client(), (Review review) -> { final SetCustomType updateAction = SetCustomType .ofTypeIdAndObjects(type.getId(), singletonMap(STRING_FIELD_NAME, "foo")); final Review updatedReview = client().executeBlocking(ReviewUpdateCommand.of(review, updateAction)); assertThat(updatedReview.getCustom().getFieldAsString(STRING_FIELD_NAME)).isEqualTo("foo"); final Review updatedReview2 = client().executeBlocking(ReviewUpdateCommand.of(updatedReview, SetCustomField.ofObject(STRING_FIELD_NAME, "bar"))); assertThat(updatedReview2.getCustom().getFieldAsString(STRING_FIELD_NAME)).isEqualTo("bar"); return updatedReview2; }); return type; });
See the test code.
Custom
Modifier and Type | Method and Description |
---|---|
static SetCustomField |
ofJson(String name,
com.fasterxml.jackson.databind.JsonNode value) |
static SetCustomField |
ofObject(String name,
Object value) |
static SetCustomField |
ofUnset(String name) |
getName, getValue
getAction
public static SetCustomField ofJson(String name, com.fasterxml.jackson.databind.JsonNode value)
public static SetCustomField ofObject(String name, Object value)
public static SetCustomField ofUnset(String name)