java.lang.Object
tools.jackson.databind.util.IgnorePropertiesUtil
- Since:
- 2.12
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classHelper class to encapsulate logic from staticshouldIgnoremethod of util class. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IgnorePropertiesUtil.CheckerbuildCheckerIfNeeded(Set<String> toIgnore, Set<String> toInclude) Factory method for creating and return aIgnorePropertiesUtil.Checkerinstance if (and only if) one needed.combineNamesToInclude(Set<String> prevToInclude, Set<String> newToInclude) Helper that encapsulates logic for combining two sets of "included names": default logic is to do intersection (name must be in both to be included in result)static booleanshouldIgnore(Object value, Collection<String> toIgnore, Collection<String> toInclude) Decide if we need to ignore a property or not, given a set of field to ignore and a set of field to include.
-
Constructor Details
-
IgnorePropertiesUtil
public IgnorePropertiesUtil()
-
-
Method Details
-
shouldIgnore
public static boolean shouldIgnore(Object value, Collection<String> toIgnore, Collection<String> toInclude) Decide if we need to ignore a property or not, given a set of field to ignore and a set of field to include. -
buildCheckerIfNeeded
public static IgnorePropertiesUtil.Checker buildCheckerIfNeeded(Set<String> toIgnore, Set<String> toInclude) Factory method for creating and return aIgnorePropertiesUtil.Checkerinstance if (and only if) one needed.- Parameters:
toIgnore- Set of property names to ignore (may be null)toInclude- Set of only property names to include (if null, undefined)- Returns:
- Checker, if validity checks are needed;
nullotherwise
-
combineNamesToInclude
public static Set<String> combineNamesToInclude(Set<String> prevToInclude, Set<String> newToInclude) Helper that encapsulates logic for combining two sets of "included names": default logic is to do intersection (name must be in both to be included in result)- Parameters:
prevToInclude- Existing set of names to include, if defined; null means "not defined"newToInclude- New set of names to included, if defined; null means "not defined"- Returns:
- Resulting set of names, using intersection if neither
null; or the non-null one (if only one isnull); ornullif both argumentsnull.
-