Package org.springframework.data.mapping
Class AccessOptions.SetOptions
java.lang.Object
org.springframework.data.mapping.AccessOptions.SetOptions
- Enclosing class:
- AccessOptions
Access options for setting values for property paths.
- Author:
- Oliver Drotbohm
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
How to propagate setting values that cross collection and map properties.static enum
How to handle intermediate null values when setting -
Constructor Summary
ConstructorDescriptionSetOptions
(AccessOptions.SetOptions.SetNulls nullHandling, AccessOptions.SetOptions.Propagation collectionPropagation, AccessOptions.SetOptions.Propagation mapPropagation) -
Method Summary
Modifier and TypeMethodDescriptionboolean
propagate
(PersistentProperty<?> property) Returns whether the given property is supposed to be propagated, i.e. if values for it are supposed to be set at all.Returns a newAccessOptions
that will cause paths that contain null values to be skipped when setting a property.Returns a newAccessOptions
that will cause paths that contain null values to be skipped when setting a property but a log message produced in TRACE level.Returns a newAccessOptions
that will cause paths that contain null values to be skipped when setting a property.Shortcut to configure the sameAccessOptions.SetOptions.Propagation
for both collection and map property path segments.withCollectionPropagation
(AccessOptions.SetOptions.Propagation collectionPropagation) withMapPropagation
(AccessOptions.SetOptions.Propagation mapPropagation) withNullHandling
(AccessOptions.SetOptions.SetNulls nullHandling)
-
Constructor Details
-
SetOptions
public SetOptions(AccessOptions.SetOptions.SetNulls nullHandling, AccessOptions.SetOptions.Propagation collectionPropagation, AccessOptions.SetOptions.Propagation mapPropagation)
-
-
Method Details
-
withNullHandling
-
withCollectionPropagation
public AccessOptions.SetOptions withCollectionPropagation(AccessOptions.SetOptions.Propagation collectionPropagation) -
withMapPropagation
public AccessOptions.SetOptions withMapPropagation(AccessOptions.SetOptions.Propagation mapPropagation) -
getNullHandling
-
skipNulls
Returns a newAccessOptions
that will cause paths that contain null values to be skipped when setting a property.- Returns:
-
skipAndLogNulls
Returns a newAccessOptions
that will cause paths that contain null values to be skipped when setting a property but a log message produced in TRACE level.- Returns:
-
rejectNulls
Returns a newAccessOptions
that will cause paths that contain null values to be skipped when setting a property.- Returns:
-
withCollectionAndMapPropagation
public AccessOptions.SetOptions withCollectionAndMapPropagation(AccessOptions.SetOptions.Propagation propagation) Shortcut to configure the sameAccessOptions.SetOptions.Propagation
for both collection and map property path segments.- Parameters:
propagation
- must not be null.- Returns:
-
propagate
Returns whether the given property is supposed to be propagated, i.e. if values for it are supposed to be set at all.- Parameters:
property
- can be null.- Returns:
-