Class CompareResultImpl

    • Field Detail

      • isEqual

        protected boolean isEqual
      • hasDifferenceInExclusion

        protected boolean hasDifferenceInExclusion
    • Constructor Detail

      • CompareResultImpl

        public CompareResultImpl()
    • Method Detail

      • writeTo

        public boolean writeTo​(String filename)
        Description copied from interface: CompareResult
        Write the result Pdf to a file. Warning: This will remove the diffImages from memory! Writing can only be done once. When no diff images are present, nothing is written.
        Specified by:
        writeTo in interface CompareResult
        Parameters:
        filename - without pdf-Extension
        Returns:
        a boolean indicating, whether the comparison is equal. When true, the files are equal.
      • writeTo

        public boolean writeTo​(OutputStream outputStream)
        Description copied from interface: CompareResult
        Write the result Pdf to an OutputStream. Warning: This will remove the diffImages from memory! Writing can only be done once. When no diff images are present, nothing is written. The given OutputStream will be closed when this method returns.
        Specified by:
        writeTo in interface CompareResult
        Parameters:
        outputStream - to write the pdfFile to.
        Returns:
        a boolean indicating, whether the comparison is equal. When true, the files are equal.
      • hasImages

        protected boolean hasImages()
        checks, whether this CompareResult has stored images.
        Returns:
        true, when images are stored in this CompareResult
      • addImagesToDocument

        protected void addImagesToDocument​(org.apache.pdfbox.pdmodel.PDDocument document)
                                    throws IOException
        Throws:
        IOException
      • keepImages

        protected boolean keepImages()
      • isEqual

        public boolean isEqual()
        Description copied from interface: CompareResult
        Returns, whether the compared documents are equal or not. Documents are also equal, when differences are only in excluded areas.
        Specified by:
        isEqual in interface CompareResult
        Returns:
        true, when no differences are found.
      • isNotEqual

        public boolean isNotEqual()
        Description copied from interface: CompareResult
        The inverse of isEqual()
        Specified by:
        isNotEqual in interface CompareResult
        Returns:
        true, when differences are found.
      • hasDifferenceInExclusion

        public boolean hasDifferenceInExclusion()
        Description copied from interface: CompareResult
        Allows to check for differences in excluded areas.
        Specified by:
        hasDifferenceInExclusion in interface CompareResult
        Returns:
        true, when there where differences in excluded areas.
      • hasOnlyExpected

        public boolean hasOnlyExpected()
        Description copied from interface: CompareResult
        Only true, when there was no actual document at all.
        Specified by:
        hasOnlyExpected in interface CompareResult
        Returns:
        true, when the actual document was missing or not readable.
      • hasOnlyActual

        public boolean hasOnlyActual()
        Description copied from interface: CompareResult
        Only true, when there was no expected document at all.
        Specified by:
        hasOnlyActual in interface CompareResult
        Returns:
        true, when the expected document was missing or not readable.
      • hasOnlyOneDoc

        public boolean hasOnlyOneDoc()
        Description copied from interface: CompareResult
        Shows, whether one of the two document to comapre was missing or unreadable.
        Specified by:
        hasOnlyOneDoc in interface CompareResult
        Returns:
        true, when only an ectual or an expected document was found or readable, but not both.
      • getNumberOfPages

        public int getNumberOfPages()
        Description copied from interface: CompareResult
        Gives that total number of pages in the result. This includes pages with differences. When the setting addEqualPagesToResult is set to true, the pages without differences are also counted.
        Specified by:
        getNumberOfPages in interface CompareResult
        Returns:
        total number of pages in the result
      • getDifferences

        public Collection<PageArea> getDifferences()
        Description copied from interface: CompareResult
        Gives a PageArea, that shows the area of a page, where differences where found. There is only one PageArea per page, which contains all differences of the page.
        Specified by:
        getDifferences in interface CompareResult
        Returns:
        a collection of PageAreas, where differences where found.
      • getPagesWithDifferences

        public Collection<Integer> getPagesWithDifferences()
        Description copied from interface: CompareResult
        Gives a collection of all the pages, that have a difference. The first page of a document is page 1.
        Specified by:
        getPagesWithDifferences in interface CompareResult
        Returns:
        collection of page numbers, that have a difference
      • expectedOnly

        public void expectedOnly()
      • actualOnly

        public void actualOnly()
      • setEnvironment

        public void setEnvironment​(Environment environment)