public interface StateCreateCommand extends DraftBasedCreateCommandDsl<State,StateDraft,StateCreateCommand>, MetaModelReferenceExpansionDsl<State,StateCreateCommand,StateExpansionModel<State>>
State
.
final LocalizedString description = LocalizedString.of(ENGLISH, "description"); final LocalizedString name = LocalizedString.of(ENGLISH, "name"); final StateDraft stateDraft = StateDraft.of(KEY, StateType.LINE_ITEM_STATE) .withDescription(description) .withName(name) .withInitial(true); final State state = client().executeBlocking(StateCreateCommand.of(stateDraft)); assertThat(state.getKey()).isEqualTo(KEY); assertThat(state.getType()).isEqualTo(StateType.LINE_ITEM_STATE); assertThat(state.getDescription()).isEqualTo(description); assertThat(state.getName()).isEqualTo(name);
See the test code.
StateDraft
,
State
Modifier and Type | Method and Description |
---|---|
static StateCreateCommand |
of(StateDraft draft)
Creates a command object to create a
State . |
getDraft, withDraft
canDeserialize, deserialize, httpRequestIntent
plusExpansionPaths, withExpansionPaths
plusExpansionPaths, plusExpansionPaths, plusExpansionPaths, plusExpansionPaths, withExpansionPaths, withExpansionPaths, withExpansionPaths, withExpansionPaths
expansionPaths
static StateCreateCommand of(StateDraft draft)
State
.draft
- template to create the new object