public interface ChannelDraft extends WithKey, CustomDraft
final String key = "demo-key"; final Address address = Address.of(DE).withCity("Berlin"); final Point geoLocation = Point.of(52.5200070, 13.4049540); final ChannelDraft channelDraft = ChannelDraft.of(key) .withName(LocalizedString.of(ENGLISH, "name")) .withDescription(LocalizedString.of(ENGLISH, "description")) .withRoles(ChannelRole.INVENTORY_SUPPLY) .withAddress(address) .withGeoLocation(geoLocation); final Channel channel = client().executeBlocking(ChannelCreateCommand.of(channelDraft)); assertThat(channel.getKey()).isEqualTo(key); assertThat(channel.getName()).isEqualTo(LocalizedString.of(ENGLISH, "name")); assertThat(channel.getDescription()).isEqualTo(LocalizedString.of(ENGLISH, "description")); assertThat(channel.getRoles()).isEqualTo(asSet(ChannelRole.INVENTORY_SUPPLY)); assertThat(channel.getAddress()).isEqualTo(address); assertThat(channel.getGeoLocation()).isEqualTo(geoLocation);
See the test code.
ChannelDraftBuilder
,
ChannelDraftDsl
Modifier and Type | Method and Description |
---|---|
Address |
getAddress() |
CustomFieldsDraft |
getCustom() |
LocalizedString |
getDescription() |
GeoJSON |
getGeoLocation() |
String |
getKey() |
LocalizedString |
getName() |
Set<ChannelRole> |
getRoles() |
static ChannelDraftDsl |
of(String key) |
@Nullable Set<ChannelRole> getRoles()
@Nullable LocalizedString getName()
@Nullable LocalizedString getDescription()
@Nullable CustomFieldsDraft getCustom()
getCustom
in interface CustomDraft
static ChannelDraftDsl of(String key)