IDEA-CR-33718 Converter to Function

This commit is contained in:
Alexandr Evstigneev
2018-06-18 16:01:53 +03:00
parent f256d560f6
commit 440d2b38ad
@@ -119,8 +119,8 @@ public class ObjectUtils {
@Contract("null, _ -> null")
@Nullable
public static <T, S> S doIfNotNull(@Nullable T obj, @NotNull Convertor<T, S> convertor) {
return obj == null ? null : convertor.convert(obj);
public static <T, S> S doIfNotNull(@Nullable T obj, @NotNull Function<T, S> function) {
return obj == null ? null : function.fun(obj);
}
@SuppressWarnings("unchecked")