Class TestError

    • Method Detail

      • builder

        public static TestError.Builder builder​(Test tester,
                                                Severity severity,
                                                int code)
        Starts building a new TestError
        Parameters:
        tester - The tester
        severity - The severity of this error
        code - The test error reference code
        Returns:
        a new test builder
        Since:
        11129
      • getMessage

        public String getMessage()
        Gets the error message
        Returns:
        the error message
      • getDescription

        public String getDescription()
        Gets the error message
        Returns:
        the error description
      • getPrimitives

        public Collection<? extends OsmPrimitivegetPrimitives()
        Gets the list of primitives affected by this error
        Returns:
        the list of primitives affected by this error
      • primitives

        public final <T extends OsmPrimitiveStream<T> primitives​(Class<T> type)
        Gets all primitives of the given type affected by this error
        Type Parameters:
        T - type of primitives
        Parameters:
        type - restrict primitives to subclasses
        Returns:
        the primitives as Stream
      • getSeverity

        public Severity getSeverity()
        Gets the severity of this error
        Returns:
        the severity of this error
      • getIgnoreState

        public String getIgnoreState()
        Returns the ignore state for this error.
        Returns:
        the ignore state for this error or null if any primitive is new
      • updateIgnored

        public boolean updateIgnored()
        Check if this error matches an entry in the ignore list and set the ignored flag if it is.
        Returns:
        the new ignored state
      • setIgnored

        public void setIgnored​(boolean state)
        Flags this error as ignored
        Parameters:
        state - The ignore flag
      • isIgnored

        public boolean isIgnored()
        Checks if this error is ignored
        Returns:
        true if it is ignored
      • getTester

        public Test getTester()
        Gets the tester that raised this error
        Returns:
        the tester that raised this error
      • getCode

        public int getCode()
        Gets the code
        Returns:
        the code
      • isFixable

        public boolean isFixable()
        Returns true if the error can be fixed automatically
        Returns:
        true if the error can be fixed
      • getFix

        public Command getFix()
        Fixes the error with the appropriate command
        Returns:
        The command to fix the error
      • setSelected

        public void setSelected​(boolean selected)
        Sets the selection flag of this error
        Parameters:
        selected - if this error is selected
      • visitHighlighted

        public void visitHighlighted​(ValidatorVisitor v)
        Visits all highlighted validation elements
        Parameters:
        v - The visitor that should receive a visit-notification on all highlighted elements
      • getHiliteNodesForArea

        private static List<List<Node>> getHiliteNodesForArea​(Area area)
        Calculate list of node pairs describing the area.
        Parameters:
        area - the area
        Returns:
        list of node pairs describing the area
      • isSelected

        public boolean isSelected()
        Returns the selection flag of this error
        Returns:
        true if this error is selected
        Since:
        5671
      • getHighlighted

        public Collection<?> getHighlighted()
        Returns The primitives or way segments to be highlighted
        Returns:
        The primitives or way segments to be highlighted
        Since:
        5671
      • isSimilar

        public boolean isSimilar​(TestError other)
        Tests if two errors are similar, i.e., same code and description and same combination of primitives and same combination of highlighted objects, but maybe with different orders.
        Parameters:
        other - the other error to be compared
        Returns:
        true if two errors are similar