/** * Convenience constructor to help with generics. * * @since 5.2.0 */ public static <S, T> CoercionTuple<S, T> create(Class<S> sourceType, Class<T> targetType, Coercion<S, T> coercion) { return new CoercionTuple<S, T>(sourceType, targetType, coercion); }
configuration.add(new CoercionTuple(String.class, WriteConcern.class, new Coercion<String, WriteConcern>() { public WriteConcern coerce(String input) configuration.add(new CoercionTuple(String.class, ReadPreference.class, new Coercion<String, ReadPreference>() { public ReadPreference coerce(String input)
tuples = extend(tuples, new CoercionTuple(sourceType, targetType, new StringToEnumCoercion(targetType))); tuples = extend(tuples, new CoercionTuple(sourceType, targetType, (value)->((Enum) value).name()));
CoercionTuple compoundTuple = new CoercionTuple(sourceType, newIntermediateType, compoundCoercer, false);