public final class SetCustomType extends SetCustomTypeBase<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 SetCustomType |
ofRemoveType() |
static SetCustomType |
ofTypeIdAndJson(String typeId,
Map<String,com.fasterxml.jackson.databind.JsonNode> fields) |
static SetCustomType |
ofTypeIdAndObjects(String typeId,
Map<String,Object> fields) |
static SetCustomType |
ofTypeKeyAndJson(String typeKey,
Map<String,com.fasterxml.jackson.databind.JsonNode> fields) |
static SetCustomType |
ofTypeKeyAndObjects(String typeKey,
Map<String,Object> fields) |
getFields, getType, mapObjectToJsonMap
getAction
public static SetCustomType ofTypeKeyAndObjects(String typeKey, Map<String,Object> fields)
public static SetCustomType ofTypeIdAndObjects(String typeId, Map<String,Object> fields)
public static SetCustomType ofTypeIdAndJson(String typeId, Map<String,com.fasterxml.jackson.databind.JsonNode> fields)
public static SetCustomType ofTypeKeyAndJson(String typeKey, Map<String,com.fasterxml.jackson.databind.JsonNode> fields)
public static SetCustomType ofRemoveType()