public final class SetTextLineItemCustomType extends SetCustomTypeBase<ShoppingList>
See also ShoppingListInStoreUpdateCommand.
withUpdateableType(client(), type -> { final ShoppingListDraftDsl shoppingListDraft = newShoppingListDraftWithTextLineItem(1L); withShoppingList(client(), shoppingListDraft, shoppingList -> { final String textLineItemId = shoppingList.getTextLineItems().get(0).getId(); final String value = randomString(); final ShoppingList updatedShoppingList = client().executeBlocking(ShoppingListUpdateCommand.of(shoppingList, SetTextLineItemCustomType.ofTypeIdAndObjects(type.getId(), STRING_FIELD_NAME, value, textLineItemId))); final TextLineItem textLineItem = updatedShoppingList.getTextLineItems().get(0); assertThat(textLineItem.getCustom().getField(STRING_FIELD_NAME, TypeReferences.stringTypeReference())) .isEqualTo(value); return updatedShoppingList; }); return type; });
See the test code.
Custom
Modifier and Type | Method and Description |
---|---|
String |
getTextLineItemId() |
static SetTextLineItemCustomType |
ofRemoveType(String textLineItemId) |
static SetTextLineItemCustomType |
ofTypeIdAndJson(String typeId,
Map<String,com.fasterxml.jackson.databind.JsonNode> fields,
String textLineItemId) |
static SetTextLineItemCustomType |
ofTypeIdAndObjects(String typeId,
Map<String,Object> fields,
String textLineItemId) |
static SetTextLineItemCustomType |
ofTypeIdAndObjects(String typeId,
String fieldName,
Object value,
String textLineItemId) |
static SetTextLineItemCustomType |
ofTypeKeyAndJson(String typeKey,
Map<String,com.fasterxml.jackson.databind.JsonNode> fields,
String textLineItemId) |
static SetTextLineItemCustomType |
ofTypeKeyAndObjects(String typeKey,
Map<String,Object> fields,
String textLineItemId) |
getFields, getType, mapObjectToJsonMap
getAction
public static SetTextLineItemCustomType ofTypeKeyAndObjects(String typeKey, Map<String,Object> fields, String textLineItemId)
public static SetTextLineItemCustomType ofTypeIdAndObjects(String typeId, Map<String,Object> fields, String textLineItemId)
public static SetTextLineItemCustomType ofTypeIdAndObjects(String typeId, String fieldName, Object value, String textLineItemId)
public static SetTextLineItemCustomType ofTypeIdAndJson(String typeId, Map<String,com.fasterxml.jackson.databind.JsonNode> fields, String textLineItemId)
public static SetTextLineItemCustomType ofTypeKeyAndJson(String typeKey, Map<String,com.fasterxml.jackson.databind.JsonNode> fields, String textLineItemId)
public static SetTextLineItemCustomType ofRemoveType(String textLineItemId)
public String getTextLineItemId()