|
16 | 16 | * Note that inclusion criteria is checked on <b>Java object level</b>
|
17 | 17 | * and <b>NOT</b> on JSON output -- so even with {@link Include#NON_NULL}
|
18 | 18 | * it is possible that JSON null values are output, if object reference
|
19 |
| - * in question is not `null`. An example is {@link java.util.concurrent.AtomicReference} |
| 19 | + * in question is not `null`. An example is {@link java.util.concurrent.atomic.AtomicReference} |
20 | 20 | * instance constructed to reference <code>null</code> value: such a value
|
21 | 21 | * would be serialized as JSON null, and not filtered out.
|
22 | 22 | * In such cases {@link Include#NON_EMPTY} should be used instead, since missing
|
@@ -75,14 +75,19 @@ public enum Include
|
75 | 75 | NON_NULL,
|
76 | 76 |
|
77 | 77 | /**
|
78 |
| - * Value that indicates that only properties that have values |
79 |
| - * that differ from default settings (meaning values they have |
80 |
| - * when Bean is constructed with its no-arguments constructor) |
81 |
| - * are to be included. Value is generally not useful with |
82 |
| - * {@link java.util.Map}s, since they have no default values; |
83 |
| - * and if used, works same as {@link #ALWAYS}. |
| 78 | + * Value that indicates that properties are included unless their value |
| 79 | + * is: |
| 80 | + *<ul> |
| 81 | + * <li>null</li> |
| 82 | + * <li>"absent" value of a referential type (like Java 8 `Optional`, or |
| 83 | + * {link java.utl.concurrent.atomic.AtomicReference}); that is, something |
| 84 | + * that would not deference to a non-null value. |
| 85 | + * </ul> |
| 86 | + * This option is mostly used to work with "Optional"s (Java 8, Guava). |
| 87 | + * |
| 88 | + * @since 2.6 |
84 | 89 | */
|
85 |
| - NON_DEFAULT, |
| 90 | + NON_ABSENT, |
86 | 91 |
|
87 | 92 | /**
|
88 | 93 | * Value that indicates that only properties that have values
|
@@ -113,8 +118,18 @@ public enum Include
|
113 | 118 | * is overridden, it will be called to see if non-null values are
|
114 | 119 | * considered empty (null is always considered empty).
|
115 | 120 | */
|
116 |
| - NON_EMPTY |
| 121 | + NON_EMPTY, |
| 122 | + |
| 123 | + /** |
| 124 | + * Value that indicates that only properties that have values |
| 125 | + * that differ from default settings (meaning values they have |
| 126 | + * when Bean is constructed with its no-arguments constructor) |
| 127 | + * are to be included. Value is generally not useful with |
| 128 | + * {@link java.util.Map}s, since they have no default values; |
| 129 | + * and if used, works same as {@link #ALWAYS}. |
| 130 | + */ |
| 131 | + NON_DEFAULT |
| 132 | + |
117 | 133 | ;
|
118 | 134 | }
|
119 |
| - |
120 | 135 | }
|
0 commit comments