@JsonCreator public static ReturnShipmentState ofSphereValue(final String value) { return SphereEnumeration.findBySphereName(values(), value).get(); } }
@Override public void serialize(final SphereEnumeration sphereEnumeration, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider) throws IOException { final String sphereName = SphereEnumeration.toSphereName(sphereEnumeration.name()); jsonGenerator.writeString(sphereName); } }
@JsonCreator public static InventoryMode ofSphereValue(final String value) { return SphereEnumeration.find(values(), value); } }
@Override public void serialize(final SphereEnumeration sphereEnumeration, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider) throws IOException { final String sphereName = sphereEnumeration.toSphereName(); jsonGenerator.writeString(sphereName); } }
default String toSphereName() { return SphereEnumerationUtils.toSphereName(name()); } }
static <T extends Enum<T>> T find(final T[] values, final String value) { return Arrays.stream(values) .filter(v -> toSphereName(v.name()).equals(value)) .findFirst().get(); }
@JsonCreator public static LineItemPriceMode ofSphereValue(final String value) { return SphereEnumeration.findBySphereName(values(), value).get(); } }
protected <E extends SphereEnumeration> List<String> transformSphereEnumeration(final Iterable<E> items) { return toStream(items) .map(enumValue -> enumValue.toSphereName()) .map(StringQuerySortingModel::normalize) .collect(Collectors.toList()); }
@JsonCreator public static CartState ofSphereValue(final String value) { return SphereEnumeration.find(values(), value); } }
@JsonCreator public static StackingMode ofSphereValue(final String value) { return SphereEnumeration.findBySphereName(values(), value).get(); } }
@Override public QueryPredicate<T> isNot(final E element) { return isNotPredicate(element.toSphereName()); }
@JsonCreator public static OrderState ofSphereValue(final String value) { return SphereEnumeration.find(values(), value); } }
@JsonCreator public static AttributeConstraint ofSphereValue(final String value) { return SphereEnumeration.findBySphereName(values(), value).get(); } }
@Override public QueryPredicate<T> is(final E enumValue) { return isPredicate(enumValue.toSphereName()); }
@JsonCreator public static PaymentState ofSphereValue(final String value) { return SphereEnumeration.find(values(), value); } }
@JsonCreator public static LineItemMode ofSphereValue(final String value) { return SphereEnumeration.findBySphereName(values(), value).get(); } }
private List<String> toSphereNameList(final Iterable<E> args) { return toStream(args) .map(e -> normalize(e.toSphereName())) .collect(toList()); }
@JsonCreator public static AttributeConstraint ofSphereValue(final String value) { return SphereEnumeration.find(values(), value); } }
@JsonCreator public static AnonymousCartSignInMode ofSphereValue(final String value) { return SphereEnumeration.findBySphereName(values(), value).get(); } }
@JsonCreator public static TextInputHint ofSphereValue(final String value) { return SphereEnumeration.find(values(), value); } }