Class DifferenceHelper

    • Constructor Detail

      • DifferenceHelper

        public DifferenceHelper()
    • Method Detail

      • compareHomes

        public static DifferenceBetweenHomes compareHomes​(AdaptationHome leftHome,
                                                          AdaptationHome rightHome,
                                                          boolean isResolvedMode)
        Compares two dataspaces or snapshots and returns the result.
        Parameters:
        leftHome - dataspace or snapshot on left to use for comparison.
        rightHome - dataspace or snapshot on right to use for comparison.
        isResolvedMode - specifies whether or not the comparison is in resolved mode.
        Throws:
        IllegalArgumentException - if one of the specified arguments is null.
      • compareDataspaceByTransactionID

        public static DifferenceBetweenHomes compareDataspaceByTransactionID​(AdaptationHome aDataspace,
                                                                             long aStartTransactionId,
                                                                             long aEndTransactionId)
        Performs a comparison between two transactions for a dataspace or a snapshot and returns the result.
        Parameters:
        aDataspace - dataspace or snapshot to use for comparison.
        aStartTransactionId - the start transaction id
        aEndTransactionId - the end transaction id
        Throws:
        IllegalArgumentException - if the specified AdaptationHome is null or if one of the specified transaction ids is negative.
      • compareDataspaceByDate

        public static DifferenceBetweenHomes compareDataspaceByDate​(AdaptationHome aDataspace,
                                                                    Date aStartDate,
                                                                    Date aEndDate)
        Performs a comparison between two transaction dates for a dataspace and returns the result.
        Parameters:
        aDataspace - the dataspace to compare
        aStartDate - the start transaction id
        aEndDate - the end transaction id
        Throws:
        IllegalArgumentException - if one of the specified arguments is null.
      • compareInstances

        public static DifferenceBetweenInstances compareInstances​(Adaptation instanceOnLeft,
                                                                  Adaptation instanceOnRight,
                                                                  boolean isResolvedMode)
        Performs a comparison between two datasets.
        Parameters:
        instanceOnLeft - dataset on left to use for comparison.
        instanceOnRight - dataset on right to use for comparison.
        isResolvedMode - specifies whether the comparison is in resolved mode.
        Throws:
        IllegalArgumentException - if one of the specified arguments is null.
      • compareDatasetByTransactionID

        public static DifferenceBetweenInstances compareDatasetByTransactionID​(Adaptation aDataset,
                                                                               long aStartTransactionId,
                                                                               long aEndTransactionId)
        Performs a comparison between two transaction for a dataset and returns the result.
        Parameters:
        aDataset - the dataset to be compared
        aStartTransactionId - the start transaction id
        aEndTransactionId - the end transaction id
        Throws:
        IllegalArgumentException - if the specified Adaptation is null or if it is a table record or one of the specified transaction ids is negative.
      • compareDatasetByDate

        public static DifferenceBetweenInstances compareDatasetByDate​(Adaptation aDataset,
                                                                      Date aStartDate,
                                                                      Date aEndDate)
        Performs a comparison between two transaction dates for a dataset and returns the result.
        Parameters:
        aDataset - the Dataset to compare
        aStartDate - the start date
        aEndDate - the end date
        Throws:
        IllegalArgumentException - if one of the specified arguments is null or if the specified Adaptation is a table record.
      • compareAdaptationTables

        public static DifferenceBetweenTables compareAdaptationTables​(AdaptationTable tableOnLeft,
                                                                      AdaptationTable tableOnRight,
                                                                      boolean isResolvedMode)
        Performs a comparison between two tables.
        Parameters:
        tableOnLeft - table on left to use for comparison.
        tableOnRight - table on right to use for comparison.
        isResolvedMode - specifies whether the comparison is in resolved mode.
        Throws:
        IllegalArgumentException - if one of the specified arguments is null or if tables do not have the same primary key definition.
      • compareTableByTxId

        public static DifferenceBetweenTables compareTableByTxId​(AdaptationTable table,
                                                                 long aStartTransactionId,
                                                                 long aEndTransactionId)
        Performs a comparison between two transaction times for a table and returns the result.
        Parameters:
        table - the table
        aStartTransactionId - the start transaction id
        aEndTransactionId - the end transaction id
        Throws:
        IllegalArgumentException - if the specified AdaptationTable is null or if one of the specified transaction ids is negative.
      • compareTableByDate

        public static DifferenceBetweenTables compareTableByDate​(AdaptationTable table,
                                                                 Date aStartDate,
                                                                 Date aEndDate)
        Performs a comparison between two dates for a table and returns the result.
        Parameters:
        table - the table to compare
        aStartDate - the start date
        aEndDate - the end date
        Throws:
        IllegalArgumentException - if one of the specified arguments is null.
      • compareOccurrences

        public static DifferenceBetweenOccurrences compareOccurrences​(Adaptation recordOnLeft,
                                                                      Adaptation recordOnRight,
                                                                      boolean isResolvedMode,
                                                                      boolean showDetails)
        Performs a comparison between two records.
        Parameters:
        recordOnLeft - record on left to use for comparison.
        recordOnRight - record on right to use for comparison.
        isResolvedMode - specifies whether the comparison is in resolved mode.
        showDetails - if true, differences on terminal complex nodes are detailed; if false, comparison stops on terminal node elements even if they are complex. showDetails is forced to false if isResolvedMode is set to false.
        Throws:
        IllegalArgumentException - if one of the specified arguments is null.
      • compareRecordByTransactionID

        public static DifferenceBetweenOccurrences compareRecordByTransactionID​(Adaptation aRecord,
                                                                                long aStartTransactionId,
                                                                                long aEndTransactionId)
        Performs a comparison between two transaction times for a record and returns the result.

        Returns null if there is no differences between the two specified transactions.

        Parameters:
        aRecord - the record to compare
        aStartTransactionId - the start transaction id
        aEndTransactionId - the end transaction id
        Throws:
        IllegalArgumentException - if the specified Adaptation is null or if it is not a table record or if one of the specified transaction ids is negative.
      • compareRecordByDate

        public static DifferenceBetweenOccurrences compareRecordByDate​(Adaptation aRecord,
                                                                       Date aStartDate,
                                                                       Date aEndDate)
        Performs a comparison between two dates for a record and returns the result.

        Returns null if there is no differences between the two specified dates.

        Parameters:
        aRecord - the record to compare
        aStartDate - the start date
        aEndDate - the end date
        Throws:
        IllegalArgumentException - if the specified Adaptation is null or if it is not a table record.