public final class SetCustomType extends SetCustomTypeBase<ShoppingList>
See also ShoppingListInStoreUpdateCommand.
withUpdateableType(client(), type -> { final CustomFieldsDraft customFieldsDraft = CustomFieldsDraftBuilder.ofType(type).addObject(STRING_FIELD_NAME, "a value").build(); final ShoppingListDraftDsl shoppingListDraft = newShoppingListDraftBuilder().custom(customFieldsDraft).build(); withShoppingList(client(), shoppingListDraft, shoppingList -> { final ShoppingListUpdateCommand shoppingListUpdateCommand = ShoppingListUpdateCommand.of(shoppingList, SetCustomType.ofTypeIdAndObjects(type.getId(), STRING_FIELD_NAME, "a value")); final ShoppingList updatedShoppingList = client().executeBlocking(shoppingListUpdateCommand); assertThat(updatedShoppingList.getCustom().getField(STRING_FIELD_NAME, TypeReferences.stringTypeReference())) .isEqualTo("a value"); return updatedShoppingList; }); 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 |
ofTypeIdAndObjects(String typeId,
String fieldName,
Object value) |
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 ofTypeIdAndObjects(String typeId, String fieldName, Object value)
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()