-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
(note: follow up to #849)
Although the original intent of NON_EMPTY
was to include a wider set of criteria, such as number values (both primitives and matching wrappers) and boolean
/Boolean
, implementation was incomplete. As a result users were under impression that NON_EMPTY
only applies to following things:
null
values of all typesCollection
s andMap
s with size 0- Arrays with length 0
- Empty Strings (length 0)
Since the fix #849 changed behavior, and since this change was not well-received, it seems best to revert the change with respect to extended types, and make int
value of 0
, for example, NOT to be excluded with criteria of NON_EMPTY
.
But the original use case that I had in mind was to minimize number of properties written, including default values. To support this option we should be able to refine meaning of existing choice NON_DEFAULT
. In addition to its meaning when used for POJOs (to mean that properties with original values when POJO is created with a default constructor), it should be possible to also allow its use for properties, and even as default exclusion settings. In those cases it should simply mean exclusion of all values covered by NON_EMPTY
and in addition exclude:
- Default numeric values for
int
,long
, short,
byte,
float,
doubleand
char`, as well as matching Wrapper values - Default value of
false
forboolean
andBoolean