Enum Class JsonInclude.Include
- All Implemented Interfaces:
Serializable, Comparable<JsonInclude.Include>, Constable
- Enclosing class:
JsonInclude
Inclusion strategy for property values
属性值的包含策略
- Since:
- JDK 25, opencode-base-json V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAlways include the property, regardless of its value.Use a custom filter to determine inclusion.Exclude properties with null values or absent Optional values.Exclude properties that have their default value (e.g., 0 for int, null for objects).Exclude properties with null values, empty strings, or empty collections/maps.Exclude properties with null values.Use defaults from class-level annotation or global configuration. -
Method Summary
Modifier and TypeMethodDescriptionstatic JsonInclude.IncludeReturns the enum constant of this class with the specified name.static JsonInclude.Include[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ALWAYS
Always include the property, regardless of its value. 始终包含该属性,无论其值是什么。 -
NON_NULL
Exclude properties with null values. 排除值为null的属性。 -
NON_ABSENT
Exclude properties with null values or absent Optional values. 排除值为null或Optional.empty()的属性。 -
NON_EMPTY
Exclude properties with null values, empty strings, or empty collections/maps. 排除值为null、空字符串或空集合/映射的属性。 -
NON_DEFAULT
Exclude properties that have their default value (e.g., 0 for int, null for objects). 排除具有默认值的属性(例如int的0、对象的null)。 -
CUSTOM
Use a custom filter to determine inclusion. 使用自定义过滤器来决定是否包含。 -
USE_DEFAULTS
Use defaults from class-level annotation or global configuration. 使用类级别注解或全局配置的默认值。
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-