Class AnyOperations


  • public final class AnyOperations
    extends Object
    Utility class for comparing AnyTO instances in order to generate AnyUR instances.
    • Method Detail

      • diff

        public static AnyObjectUR diff​(AnyObjectTO updated,
                                       AnyObjectTO original,
                                       boolean incremental)
        Calculate modifications needed by first in order to be equal to second.
        Parameters:
        updated - updated AnyObjectTO
        original - original AnyObjectTO
        incremental - perform incremental diff (without removing existing info)
        Returns:
        AnyObjectUR containing differences
      • diff

        public static UserUR diff​(UserTO updated,
                                  UserTO original,
                                  boolean incremental)
        Calculate modifications needed by first in order to be equal to second.
        Parameters:
        updated - updated UserTO
        original - original UserTO
        incremental - perform incremental diff (without removing existing info)
        Returns:
        UserUR containing differences
      • diff

        public static GroupUR diff​(GroupTO updated,
                                   GroupTO original,
                                   boolean incremental)
        Calculate modifications needed by first in order to be equal to second.
        Parameters:
        updated - updated GroupTO
        original - original GroupTO
        incremental - perform incremental diff (without removing existing info)
        Returns:
        GroupUR containing differences
      • diff

        public static <TO extends AnyTO,​P extends AnyUR> P diff​(TO updated,
                                                                      TO original,
                                                                      boolean incremental)
      • cleanEmptyAttrs

        public static void cleanEmptyAttrs​(AnyTO anyTO,
                                           AnyUR anyUR)
        Add PLAIN attribute DELETE patch for those attributes of the input AnyTO without values or containing null value
        Parameters:
        anyTO - User, Group or Any Object to look for attributes with no value
        anyUR - update req to enrich with DELETE statements