public enum Include

{

/**

* Value that indicates that property is to be always included,

* independent of value of the property.

* 包含所有属性,默认为ALWAYS

*/

ALWAYS,

/**

* Value that indicates that only properties with non-null

* values are to be included.

* 包含不为NUll的属性

*/

NON_NULL,

/**

* Value that indicates that properties are included unless their value

* is:

*

*

null

*

"absent" value of a referential type (like Java 8 `Optional`, or

* {link java.utl.concurrent.atomic.AtomicReference}); that is, something

* that would not deference to a non-null value.

*

* This option is mostly used to work with "Optional"s (Java 8, Guava).

*

* @since 2.6

*/

NON_ABSENT,

/**

* Value that indicates that only properties with null value,

* or what is considered empty, are not to be included.

* Definition of emptiness is data type specific; see below

* for details on actual handling.

*

* Default emptiness for all types includes:

*

*

Null values.

*

"Absent" values (see {@link #NON_ABSENT})

*

* so that as baseline, "empty" set includes values that would be

* excluded by both {@link #NON_NULL} and {@link #NON_ABSENT}.

*

* Beyond this base, following types have additional empty values:

*

*

For {@link java.util.Collection}s and {@link java.util.Map}s,

* method isEmpty() is called;

*

*

For Java arrays, empty arrays are ones with length of 0

*

*

For Java {@link java.lang.String}s, length() is called,

* and return value of 0 indicates empty String

*

*

* and for other types, null values are excluded but other exclusions (if any).

*

* Note that this default handling can be overridden by custom

* JsonSerializer implementation: if method isEmpty()

* is overridden, it will be called to see if non-null values are

* considered empty (null is always considered empty).

*

* Compatibility note: Jackson 2.6 included a wider range of "empty" values than

* either earlier (up to 2.5) or later (2.7 and beyond) types; specifically:

*

*

Default values of primitive types (like 0 for `int`/`java.lang.Integer`

* and `false` for `bool`/`Boolean`)

*

*

Timestamp 0 for date/time types

*

*

* With 2.7, definition has been tightened back to only containing types explained

* above (null, absent, empty String, empty containers), and now

* extended definition may be specified using {@link #NON_DEFAULT}.

*/

NON_EMPTY,

/**

* Meaning of this setting depends on context: whether annotation is

* specified for POJO type (class), or not. In latter case annotation

* is either used as the global default, or as property override.

*

* When used for a POJO, definition is that only values that differ from

* the default values of POJO properties are included. This is done

* by creating an instance of POJO using zero-argument constructor,

* and accessing property values: value is used as the default value

* by using equals() method, except for the case where property

* has `null` value in which straight null check is used.

*

* When NOT used for a POJO (that is, as a global default, or as property

* override), definition is such that:

*

*

All values considered "empty" (as per {@link #NON_EMPTY}) are excluded

*

Primitive/wrapper default values are excluded

*

Date/time values that have timestamp (`long` value of milliseconds since

* epoch, see {@link java.util.Date}) of `0L` are excluded

*

*/

NON_DEFAULT,

/**

* Pseudo-value used to indicate that the higher-level defaults make

* sense, to avoid overriding inclusion value. For example, if returned

* for a property this would use defaults for the class that contains

* property, if any defined; and if none defined for that, then

* global serialization inclusion details.

*

* @since 2.6

*/

USE_DEFAULTS

;

}

java如果属性为空返回其他_后台返回前台数据(实体类)如果存在为空或‘’的属性,如何过滤掉...相关推荐

  1. java类作为多层级的数据实体_API json多层数据实体类封装(利用泛型技术)

    完整源码查看点击进入:github地址 1: API json多层数据实体类封装(利用泛型技术) RootEntity.java public class RootEntity{ private in ...

  2. 小程序 后台返回的对象数组(每个数组添加一个新的属性值)

    upshow属性是在请求到后台的数据后逐条添加的,经常用于控制 当前数据的显示与否或者箭头的指向 //给后台返还的数据就对象加对象属性值array.forEach((r) => { //arra ...

  3. java后端参数默认值添加枚举_利用自定义Validator和枚举类来限定接口的入参

    趁热记录下,给未来的自己 0. 前言 Spring Validation 作为一个参数验证框架,本身提供的注解已经很强大了,能覆盖大部分业务场景需求,比如:@NotNull, @NotBlank, @ ...

  4. springcloud工作笔记091---tk.mybatis.mapper.MapperException: 当前实体类不包含名为XXXXX的属性!

    技术交流QQ群[JAVA,C++,Python,.NET,BigData,AI]:170933152 这个问题主要是由于类型对应不起来导致的, 比如: 1.原因1: 这个报错找了半天,基本规范自己也核 ...

  5. java中Long类型传参校验注解_JAVA——实现json bean实体类的传参校验模板及注解详解...

    关注wx:CodingTechWork,一起学习进步. 引言 在java开发中,经常需要和外界系统进行参数对接,api设计中难免会遇到json传参不一致的情况,虽然纸面或者接口规范约束了应该怎么传参, ...

  6. tk.mybatis.mapper.MapperException: 当前实体类不包含名为XXXXX的属性!

    这个报错找了半天,基本规范自己也核对过了,全没毛病 后来发现是因为我得实体类的属性用的是int 改成integer就好了 应该是只能映射包装类型 分享给遇到同样问题的同学,略坑 转载于:https:/ ...

  7. Java导出Excel加电子回章_使用Excel制作一个喜欢的DIY电子印章

    大家好我是不加班, 今天分享的内容是个性化电子印章的制作,可以使用Excel制作出一个印章,当然可以根据自己的喜欢定制哦! 首先,点击"插入",选择 "形状", ...

  8. python定义一个dog类 类属性有名字毛色体重_全面了解python中的类,对象,方法,属性...

    python中一切皆为对象,所谓对象:我自己就是一个对象,我玩的电脑就是对象,坐着的椅子就是对象,家里养的小狗也是一个对象...... 我们通过描述属性(特征)和行为来描述一个对象的.比如家里的小狗, ...

  9. Java代码给csv文件加水印_如何给CSV数据包的图片批量加上水印

    批量加水印要用到加水印的工具了吧 一.发布产品的时候,你的图片传到网上去的时候,都有一个选项,是否要在图片上加水印,系统默认的都是加水印的,你只要不选否,都是加了的. 二.photoshop加水印 1 ...

最新文章

  1. 腐蚀rust电脑分辨率调多少_腐蚀Rust怎么设置画面 腐蚀Rust提高帧数画面设置方法...
  2. 不懂 Zookeeper?没关系,看这篇就够了!
  3. CVPR2021 图像匹配挑战赛,双赛道冠亚军方案
  4. SSRS - 请求因 HTTP 状态 401 失败: Unauthorized。
  5. 计算机视觉开源库OpenCV梯度之Sobel算子
  6. 本地仓库管理权限问题
  7. mybatis实现分页查询-自己封装分页方法
  8. cordova flie文件目录_Cordova文件插件目录错误
  9. app网站换服务器,app切换服务器
  10. 【Java】 剑指offer(27) 二叉树的镜像
  11. PHP自学--第一天
  12. oracle-- 文字与格式字符串不匹配
  13. 手机上有没有学python的软件-哪个手机软件有python题库
  14. 窃取百度搜索结果曝光,今日头条一直穿着“皇帝的新装”?
  15. 85 缓存, 验证码 序列化
  16. 软件项目的规模、工作量和成本是如何进行估算或评估的?
  17. shapley和树的shap
  18. python实用例子
  19. 计算机软件网络工程师考试试题,计算机软件水平考试《网络工程师》试题及答案(6)...
  20. testmeshpro合批_Unity合批原理及失败的原因

热门文章

  1. 经典的X/OpenDTP事务模型
  2. EasyExcel实现写操作
  3. 常用的函数式接口_Predicate接口
  4. 使用Lambda优化日志案例
  5. Set集合存储元素不重复的原理
  6. 斗地主案例的代码实现
  7. 数据仓库分层和元数据管理
  8. HDFS的API操作-小文件的合并
  9. 图片存储解决方案的分析
  10. API Gateway简介