Class IgnorePropertiesUtil


  • public class IgnorePropertiesUtil
    extends java.lang.Object
    Since:
    2.12
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  IgnorePropertiesUtil.Checker
      Helper class to encapsulate logic from static shouldIgnore method of util class.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static IgnorePropertiesUtil.Checker buildCheckerIfNeeded​(java.util.Set<java.lang.String> toIgnore, java.util.Set<java.lang.String> toInclude)
      Factory method for creating and return a IgnorePropertiesUtil.Checker instance if (and only if) one needed.
      static java.util.Set<java.lang.String> combineNamesToInclude​(java.util.Set<java.lang.String> prevToInclude, java.util.Set<java.lang.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 boolean shouldIgnore​(java.lang.Object value, java.util.Collection<java.lang.String> toIgnore, java.util.Collection<java.lang.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.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IgnorePropertiesUtil

        public IgnorePropertiesUtil()
    • Method Detail

      • shouldIgnore

        public static boolean shouldIgnore​(java.lang.Object value,
                                           java.util.Collection<java.lang.String> toIgnore,
                                           java.util.Collection<java.lang.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​(java.util.Set<java.lang.String> toIgnore,
                                                                        java.util.Set<java.lang.String> toInclude)
        Factory method for creating and return a IgnorePropertiesUtil.Checker instance 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; null otherwise
      • combineNamesToInclude

        public static java.util.Set<java.lang.String> combineNamesToInclude​(java.util.Set<java.lang.String> prevToInclude,
                                                                            java.util.Set<java.lang.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 is null); or null if both arguments null.