public final class SetSupplyChannel extends UpdateActionImpl<InventoryEntry>
See also InventoryEntryUpdateCommand.
withChannelOfRole(client(), ChannelRole.INVENTORY_SUPPLY, channel -> {
withUpdateableInventoryEntry(client(), entry -> {
final UpdateAction<InventoryEntry> action = SetSupplyChannel.of(channel.toResourceIdentifier());
final InventoryEntry updatedEntry = client().executeBlocking(InventoryEntryUpdateCommand.of(entry, action));
assertThat(updatedEntry.getSupplyChannel()).isEqualTo(channel.toReference());
return updatedEntry;
});
});
See the test code.
Modifier and Type | Method and Description |
---|---|
ResourceIdentifier<Channel> |
getSupplyChannel() |
static SetSupplyChannel |
of(ResourceIdentifier<Channel> supplyChannel) |
static SetSupplyChannel |
ofReferencable(Referenceable<Channel> supplyChannel)
Deprecated.
|
getAction
@Deprecated public static SetSupplyChannel ofReferencable(@Nullable Referenceable<Channel> supplyChannel)
of(ResourceIdentifier)
public static SetSupplyChannel of(@Nullable ResourceIdentifier<Channel> supplyChannel)
@Nullable public ResourceIdentifier<Channel> getSupplyChannel()