Class DiffUtil


  • public class DiffUtil
    extends Object
    Author:
    Jakub Senko 'jsenko@redhat.com'
    • Constructor Detail

      • DiffUtil

        public DiffUtil()
    • Method Detail

      • diffAddedRemoved

        public static boolean diffAddedRemoved​(DiffContext ctx,
                                               Object original,
                                               Object updated,
                                               DiffType addedType,
                                               DiffType removedType)
        added/removed
        Returns:
        true if both objects are present
      • diffSubschemaAddedRemoved

        public static boolean diffSubschemaAddedRemoved​(DiffContext ctx,
                                                        Object original,
                                                        Object updated,
                                                        DiffType addedType,
                                                        DiffType removedType)
        Returns:
        true if both objects are present
      • diffInteger

        public static boolean diffInteger​(DiffContext ctx,
                                          Integer original,
                                          Integer updated,
                                          DiffType addedType,
                                          DiffType removedType,
                                          DiffType increasedType,
                                          DiffType decreasedType)
        added/removed/increased/decreased
        Returns:
        true if the integers are defined and equal
      • diffNumberOriginalMultipleOfUpdated

        public static void diffNumberOriginalMultipleOfUpdated​(DiffContext ctx,
                                                               Number original,
                                                               Number updated,
                                                               DiffType multipleOfType,
                                                               DiffType notMultipleOfType)
      • diffObjectDefault

        public static void diffObjectDefault​(DiffContext ctx,
                                             Object original,
                                             Object updated,
                                             Object defaultValue,
                                             DiffType addedType,
                                             DiffType removedType,
                                             DiffType changedType)
        added/removed/changed (using equals), with a default value specified
      • diffSchemaOrTrue

        public static void diffSchemaOrTrue​(DiffContext ctx,
                                            org.everit.json.schema.Schema original,
                                            org.everit.json.schema.Schema updated,
                                            DiffType bothType,
                                            DiffType extendedType,
                                            DiffType narrowedType,
                                            DiffType noneType)
      • compareSchema

        public static void compareSchema​(DiffContext ctx,
                                         org.everit.json.schema.Schema original,
                                         org.everit.json.schema.Schema updated,
                                         DiffType addedType,
                                         DiffType removedType,
                                         DiffType bothType,
                                         DiffType backwardNotForwardType,
                                         DiffType forwardNotBackwardType,
                                         DiffType noneType)
      • compareSchemaWhenExist

        public static void compareSchemaWhenExist​(DiffContext ctx,
                                                  org.everit.json.schema.Schema original,
                                                  org.everit.json.schema.Schema updated,
                                                  DiffType bothType,
                                                  DiffType backwardType,
                                                  DiffType forwardType,
                                                  DiffType noneType)
      • isSchemaCompatible

        public static boolean isSchemaCompatible​(DiffContext ctx,
                                                 org.everit.json.schema.Schema original,
                                                 org.everit.json.schema.Schema updated,
                                                 boolean backward)
      • getExceptionally

        public static <T> T getExceptionally​(DiffContext ctx,
                                             Supplier<T> getter)
        Use getter and return null if there is an exception.