public static SetCustomField ofJson(final String name, final JsonNode value) { return new SetCustomField(name, value); }
public static SetCustomField ofUnset(final String name) { return ofJson(name, null); } }
@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 SetCustomField ofUnset(final String name) { return ofJson(name, null); } }
public static SetCustomField ofJson(final String name, final JsonNode value) { return new SetCustomField(name, value); }
public static SetCustomField ofUnset(final String name) { return ofJson(name, null); } }
public static SetCustomField ofJson(final String name, final JsonNode value) { return new SetCustomField(name, value); }
public static SetCustomField ofObject(final String name, final Object value) { final JsonNode jsonNode = SphereJsonUtils.toJsonNode(value); return ofJson(name, jsonNode); }
public static SetCustomField ofObject(final String name, final Object value) { final JsonNode jsonNode = SphereJsonUtils.toJsonNode(value); return ofJson(name, jsonNode); }
public static SetCustomField ofObject(final String name, final Object value) { final JsonNode jsonNode = SphereJsonUtils.toJsonNode(value); return ofJson(name, jsonNode); }