mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-CR-33718 Converter to Function
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user