T
- the type of the value in the custom objectpublic interface CustomObjectUpsertCommand<T> extends DraftBasedCreateCommand<CustomObject<T>,CustomObjectDraft<T>>
Command for creating or updating a custom object.
Upsert is a synthetic word which has its origins from "update" and "insert".final String container = "CustomObjectFixtures"; final String key = randomKey(); final Foo value = FOO_DEFAULT_VALUE; final CustomObjectDraft<Foo> draft = CustomObjectDraft.ofUnversionedUpsert(container, key, value, Foo.class); final CustomObjectUpsertCommand<Foo> createCommand = CustomObjectUpsertCommand.of(draft); final CustomObject<Foo> customObject = client.executeBlocking(createCommand); assertThat(customObject.getContainer()).isEqualTo(container); assertThat(customObject.getKey()).isEqualTo(key); final Foo loadedValue = customObject.getValue(); assertThat(loadedValue).isEqualTo(value); //end example parsing here return customObject;
See the test code.
CustomObject
Modifier and Type | Method and Description |
---|---|
static <T> CustomObjectUpsertCommand<T> |
of(CustomObjectDraft<T> draft) |
getDraft
canDeserialize, deserialize, httpRequestIntent
static <T> CustomObjectUpsertCommand<T> of(CustomObjectDraft<T> draft)