日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

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

發布時間:2024/4/11 编程问答 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java如果属性为空返回其他_后台返回前台数据(实体类)如果存在为空或‘’的属性,如何过滤掉... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

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如果属性为空返回其他_后台返回前台数据(实体类)如果存在为空或‘’的属性,如何过滤掉...的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。