public static SetCustomType ofTypeKeyAndJson(final String typeKey, final Map<String, JsonNode> fields) { return new SetCustomType(null, typeKey, fields); }
public static SetCustomType ofTypeKeyAndObjects(final String typeKey, final Map<String, Object> fields) { final Map<String, JsonNode> fieldsJson = mapObjectToJsonMap(fields); return ofTypeKeyAndJson(typeKey, fieldsJson); }
public static SetCustomType ofTypeIdAndObjects(final String typeId, final Map<String, Object> fields) { final Map<String, JsonNode> fieldsJson = mapObjectToJsonMap(fields); return ofTypeIdAndJson(typeId, fieldsJson); }
@Test public void setCustomType() { withUpdateableType(client(), type -> { withOrder(client(), order -> { final Order orderWithType = client().executeBlocking(OrderUpdateCommand.of(order, SetCustomType.ofTypeIdAndObjects(type.getId(), CUSTOM_FIELDS_MAP))); assertThat(orderWithType.getCustom().getType()).isEqualTo(type.toReference()); assertThat(orderWithType.getCustom().getField(STRING_FIELD_NAME, TypeReferences.stringTypeReference())).isEqualTo("hello"); final Order updatedOrder = client().executeBlocking(OrderUpdateCommand.of(orderWithType, SetCustomField.ofObject(STRING_FIELD_NAME, "other"))); assertThat(updatedOrder.getCustom().getField(STRING_FIELD_NAME, TypeReferences.stringTypeReference())).isEqualTo("other"); //test clean up return client().executeBlocking(OrderUpdateCommand.of(updatedOrder, SetCustomType.ofRemoveType())); }); return type; }); }
public static SetCustomType ofTypeKeyAndObjects(final String typeKey, final Map<String, Object> fields) { final Map<String, JsonNode> fieldsJson = mapObjectToJsonMap(fields); return ofTypeKeyAndJson(typeKey, fieldsJson); }
public static SetCustomType ofTypeIdAndObjects(final String typeId, final Map<String, Object> fields) { final Map<String, JsonNode> fieldsJson = mapObjectToJsonMap(fields); return ofTypeIdAndJson(typeId, fieldsJson); }
public static SetCustomType ofRemoveType() { return new SetCustomType(null, null, null); } }
public static SetCustomType ofTypeKeyAndObjects(final String typeKey, final Map<String, Object> fields) { final Map<String, JsonNode> fieldsJson = mapObjectToJsonMap(fields); return ofTypeKeyAndJson(typeKey, fieldsJson); }
public static SetCustomType ofTypeIdAndObjects(final String typeId, final Map<String, Object> fields) { final Map<String, JsonNode> fieldsJson = mapObjectToJsonMap(fields); return ofTypeIdAndJson(typeId, fieldsJson); }
public static SetCustomType ofRemoveType() { return new SetCustomType(null, null, null); } }
public static SetCustomType ofRemoveType() { return new SetCustomType(null, null, null); } }
public static SetCustomType ofTypeIdAndJson(final String typeId, final Map<String, JsonNode> fields) { return new SetCustomType(typeId, null, fields); }
public static SetCustomType ofTypeIdAndJson(final String typeId, final Map<String, JsonNode> fields) { return new SetCustomType(typeId, null, fields); }
public static SetCustomType ofTypeKeyAndJson(final String typeKey, final Map<String, JsonNode> fields) { return new SetCustomType(null, typeKey, fields); }
public static SetCustomType ofTypeIdAndJson(final String typeId, final Map<String, JsonNode> fields) { return new SetCustomType(typeId, null, fields); }
public static SetCustomType ofTypeKeyAndJson(final String typeKey, final Map<String, JsonNode> fields) { return new SetCustomType(null, typeKey, fields); }