Android 关于@NonNull
2015-10-22 19:19
309 查看
我们直接上代码的源码解释:
/**
* Denotes that a parameter, field or method return value can never be null.
* <p>
* This is a marker annotation and it has no specific attributes.
*/
//解释:指明一个参数,字段或者方法的返回值不可以为null;
//这是一个动画标记,没有特定的属性值;
//即,如果本地一个变量值为空(例如,前面的代码检测此变量是否为空),然后你传递一个null的
//变量到一个被@NonNull修饰(标记)的参数的方法中时,开发工具IDE会警告程序可能会有崩溃的风险。
//这个是一个静态的分析方法,运行时不报任何警告。
import android.support.annotation.NonNull;
public @interface NonNull {}
/**
* Denotes that a parameter, field or method return value can never be null.
* <p>
* This is a marker annotation and it has no specific attributes.
*/
//解释:指明一个参数,字段或者方法的返回值不可以为null;
//这是一个动画标记,没有特定的属性值;
//即,如果本地一个变量值为空(例如,前面的代码检测此变量是否为空),然后你传递一个null的
//变量到一个被@NonNull修饰(标记)的参数的方法中时,开发工具IDE会警告程序可能会有崩溃的风险。
//这个是一个静态的分析方法,运行时不报任何警告。
import android.support.annotation.NonNull;
public @interface NonNull {}
相关文章推荐
- Android逆向之旅---SO(ELF)文件格式详解
- Android 颜色透明度计算
- Android的handler详解
- ANDROID仿淘宝商品浏览滑(拖)动查看详情界面
- Device Compatibility
- Android基础入门教程——8.3.3 Paint API之—— MaskFilter(面具)
- Android Studio下多渠道打包
- Android Studio下多渠道打包
- android屏幕适配
- Xamarin.Android之绑定库集合
- android应用无法连接到bmob云端解决方案
- Android studio gradle 生成字段属性值
- Android之BaseAdapter的优雅实现
- Android之BaseAdapter的优雅实现
- Android:Android Fragment嵌套使用存在的一些BUG以及解决方法
- Android中实现蓝牙录放音
- android RecyclerView的基本介绍及用法(一)
- 【Android效果集】弹幕效果
- Android: Launching activities
- android 5.0的input init过程