标签:android api 判空类
转载请注明出处:http://blog.csdn.net/droyon/article/details/39938677
在进行Android应用程序开发中,android提供了一个很好的工具类,来进行参数的检查。
Preconditions.checkNotNull(horiz, "missing horiz");这个类叫做Preconditions,在framework/base/core/java/com/android.internal/util中。
其实现为:
public static <T> T checkNotNull(T reference, Object errorMessage) { if (reference == null) { throw new NullPointerException(String.valueOf(errorMessage)); } return reference; }
标签:android api 判空类
原文地址:http://blog.csdn.net/droyon/article/details/39938677