Enum Class JsonInclude.Include

java.lang.Object
java.lang.Enum<JsonInclude.Include>
cloud.opencode.base.json.annotation.JsonInclude.Include
All Implemented Interfaces:
Serializable, Comparable<JsonInclude.Include>, Constable
Enclosing class:
JsonInclude

public static enum JsonInclude.Include extends Enum<JsonInclude.Include>
Inclusion strategy for property values 属性值的包含策略
Since:
JDK 25, opencode-base-json V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Enum Constant Details

    • ALWAYS

      public static final JsonInclude.Include ALWAYS
      Always include the property, regardless of its value. 始终包含该属性,无论其值是什么。
    • NON_NULL

      public static final JsonInclude.Include NON_NULL
      Exclude properties with null values. 排除值为null的属性。
    • NON_ABSENT

      public static final JsonInclude.Include NON_ABSENT
      Exclude properties with null values or absent Optional values. 排除值为null或Optional.empty()的属性。
    • NON_EMPTY

      public static final JsonInclude.Include NON_EMPTY
      Exclude properties with null values, empty strings, or empty collections/maps. 排除值为null、空字符串或空集合/映射的属性。
    • NON_DEFAULT

      public static final JsonInclude.Include NON_DEFAULT
      Exclude properties that have their default value (e.g., 0 for int, null for objects). 排除具有默认值的属性(例如int的0、对象的null)。
    • CUSTOM

      public static final JsonInclude.Include CUSTOM
      Use a custom filter to determine inclusion. 使用自定义过滤器来决定是否包含。
    • USE_DEFAULTS

      public static final JsonInclude.Include USE_DEFAULTS
      Use defaults from class-level annotation or global configuration. 使用类级别注解或全局配置的默认值。
  • Method Details

    • values

      public static JsonInclude.Include[] 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

      public static JsonInclude.Include valueOf(String name)
      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 name
      NullPointerException - if the argument is null