Objects.requireNonNull

public static <T> T requireNonNull(T obj) {
        if (obj == null)
            throw new NullPointerException();
        return obj;
    }

 

posted @ 2020-06-10 18:23  huxiaojie  阅读(730)  评论(0编辑  收藏  举报