public enum ValueExistencePolicy extends Enum<ValueExistencePolicy>
MetadataStandard.asValueMap(…)
shall contain entries for null,
nil or empty values. By default the value map does not provide
entries for null
metadata properties, nil objects or
empty collections.
This enumeration allows to control this behavior.
null
in the Java sense.
Null references can be used for missing properties when no information is provided about why the property is missing.
On the other hand, a nil object is a placeholder for a missing property similar in purpose to null
references,
except that an explanation about why the property is missing can be attached to those objects.
Those explanations can be obtained by calls to the NilReason.forObject(Object)
method.MetadataStandard.asValueMap(Object, KeyNamePolicy, ValueExistencePolicy)
Defined in the sis-metadata
module
Enum Constant and Description |
---|
ALL
Includes all entries in the map, including those having a null value or an empty collection.
|
NON_EMPTY
Includes only the properties that are non-null, non-nil and non empty.
|
NON_NIL
Includes only the non-null and non-nil properties.
|
NON_NULL
Includes only the non-null properties.
|
Modifier and Type | Method and Description |
---|---|
static ValueExistencePolicy |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ValueExistencePolicy[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ValueExistencePolicy ALL
public static final ValueExistencePolicy NON_NULL
public static final ValueExistencePolicy NON_NIL
The set of NON_NIL
properties is a subset of NON_NULL
properties.
public static final ValueExistencePolicy NON_EMPTY
AbstractMetadata.asMap()
.
The set of NON_EMPTY
properties is a subset of NON_NIL
properties.
public static ValueExistencePolicy[] values()
for (ValueExistencePolicy c : ValueExistencePolicy.values()) System.out.println(c);
public static ValueExistencePolicy valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright © 2010–2015 The Apache Software Foundation. All rights reserved.