public final class AddTextLineItem extends UpdateActionImpl<ShoppingList> implements CustomDraft
See also ShoppingListInStoreUpdateCommand.
withTaxedProduct(client(), product -> { withUpdateableShoppingList(client(), shoppingList -> { final LocalizedString name = en(randomString()); final ShoppingList updatedShoppingList = client().executeBlocking( ShoppingListUpdateCommand.of(shoppingList, AddTextLineItem.of(name).withQuantity(2L))); assertThat(updatedShoppingList.getTextLineItems()).hasSize(1); final TextLineItem textLineItem = updatedShoppingList.getTextLineItems().get(0); assertThat(textLineItem.getName()).isEqualTo(name); assertThat(textLineItem.getQuantity()).isEqualTo(2); assertThat(textLineItem.getAddedAt()).isNotNull(); return updatedShoppingList; }); });
See the test code.
ShoppingList.getTextLineItems()
Modifier and Type | Method and Description |
---|---|
ZonedDateTime |
getAddedAt() |
CustomFieldsDraft |
getCustom() |
LocalizedString |
getDescription() |
LocalizedString |
getName() |
Long |
getQuantity() |
static AddTextLineItem |
of(LocalizedString name) |
AddTextLineItem |
withAddedAt(ZonedDateTime addedAt) |
AddTextLineItem |
withCustom(CustomFieldsDraft custom) |
AddTextLineItem |
withDescription(LocalizedString description) |
AddTextLineItem |
withQuantity(Long quantity) |
getAction
public static AddTextLineItem of(LocalizedString name)
public LocalizedString getName()
@Nullable public LocalizedString getDescription()
@Nullable public CustomFieldsDraft getCustom()
getCustom
in interface CustomDraft
@Nullable public ZonedDateTime getAddedAt()
public AddTextLineItem withQuantity(@Nullable Long quantity)
public AddTextLineItem withCustom(@Nullable CustomFieldsDraft custom)
public AddTextLineItem withDescription(@Nullable LocalizedString description)
public AddTextLineItem withAddedAt(@Nullable ZonedDateTime addedAt)