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