Class OccurrenceMatchingResult

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<OccurrenceMatchingResult> getMultiple()
      Returns the list of multiple matches (if any).
      org.openqa.selenium.Rectangle getRect()
      Returns rectangle of the partial image occurrence.
      org.openqa.selenium.Rectangle getRect​(int matchIndex)
      Returns rectangle of the partial image occurrence for the given match index.
      double getScore()
      Returns the score of the partial image occurrence.
      double getScore​(int matchIndex)
      Returns the score of the partial image occurrence for the given match index.
      byte[] getVisualization()
      Returns the visualization of the matching result.
      byte[] getVisualization​(int matchIndex)
      Returns the visualization of the partial image occurrence for the given match index.
      boolean hasMultiple()
      Check whether the current instance contains multiple matches.
      void storeVisualization​(int matchIndex, java.io.File destination)
      Stores visualization image into the given file.
      void storeVisualization​(java.io.File destination)
      Stores visualization image into the given file.
      • Methods inherited from class java.lang.Object

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

      • OccurrenceMatchingResult

        public OccurrenceMatchingResult​(java.lang.Object input)
    • Method Detail

      • hasMultiple

        public boolean hasMultiple()
        Check whether the current instance contains multiple matches.
        Returns:
        True or false.
      • getRect

        public org.openqa.selenium.Rectangle getRect()
        Returns rectangle of the partial image occurrence.
        Returns:
        The region of the partial image occurrence on the full image.
      • getRect

        public org.openqa.selenium.Rectangle getRect​(int matchIndex)
        Returns rectangle of the partial image occurrence for the given match index.
        Parameters:
        matchIndex - Match index.
        Returns:
        Matching rectangle.
        Throws:
        java.lang.IllegalStateException - If the current instance does not represent multiple matches.
      • getScore

        public double getScore()
        Returns the score of the partial image occurrence.
        Returns:
        Matching score in range 0..1.
      • getScore

        public double getScore​(int matchIndex)
        Returns the score of the partial image occurrence for the given match index.
        Parameters:
        matchIndex - Match index.
        Returns:
        Matching score in range 0..1.
        Throws:
        java.lang.IllegalStateException - If the current instance does not represent multiple matches.
      • getVisualization

        public byte[] getVisualization()
        Returns the visualization of the matching result.
        Overrides:
        getVisualization in class ComparisonResult
        Returns:
        The visualization of the matching result represented as base64-encoded PNG image.
      • getVisualization

        public byte[] getVisualization​(int matchIndex)
        Returns the visualization of the partial image occurrence for the given match index.
        Parameters:
        matchIndex - Match index.
        Returns:
        The visualization of the matching result represented as base64-encoded PNG image.
        Throws:
        java.lang.IllegalStateException - If the current instance does not represent multiple matches.
      • storeVisualization

        public void storeVisualization​(java.io.File destination)
                                throws java.io.IOException
        Stores visualization image into the given file.
        Overrides:
        storeVisualization in class ComparisonResult
        Parameters:
        destination - File path to save the image to.
        Throws:
        java.io.IOException - On file system I/O error.
      • storeVisualization

        public void storeVisualization​(int matchIndex,
                                       java.io.File destination)
                                throws java.io.IOException
        Stores visualization image into the given file.
        Parameters:
        matchIndex - Match index.
        destination - File path to save the image to.
        Throws:
        java.io.IOException - On file system I/O error.
        java.lang.IllegalStateException - If the current instance does not represent multiple matches.
      • getMultiple

        public java.util.List<OccurrenceMatchingResult> getMultiple()
        Returns the list of multiple matches (if any). This property only works if the `multiple` option is enabled.
        Returns:
        The list containing properties of each single match or an empty list.
        Throws:
        java.lang.IllegalStateException - If the current instance does not represent multiple matches.
        Since:
        Appium 1.21.0