@SuppressWarnings({ "unchecked", "rawtypes" }) public static <T> Function<String, T> stringToEnumUntyped(final Class<? super T> type, @Nullable final T defaultValue) { if (!type.isEnum()) return new Functionals.ConstantFunction<String,T>(null); return new StringToEnumFunction((Class<Enum>)type, (Enum)defaultValue); }
public <O> IfFunctionBuilder<I,O> value(O value) { return apply(new Functionals.ConstantFunction<I,O>(value, value)); } @SuppressWarnings("unchecked")
public IfFunctionBuilder<I,O> value(O value) { return apply(new Functionals.ConstantFunction<I,O>(value, value)); } @SuppressWarnings("unchecked")
public IfFunctionBuilder<I,O> defaultValue(O defaultValue) { return defaultApply(new Functionals.ConstantFunction<I,O>(defaultValue, defaultValue)); } @SuppressWarnings("unchecked")