Class ValidationTask

    • Constructor Detail

      • ValidationTask

        public ValidationTask​(java.util.Collection<Test> tests,
                              java.util.Collection<OsmPrimitive> validatedPrimitives,
                              java.util.Collection<OsmPrimitive> formerValidatedPrimitives)
        Constructs a new ValidationTask
        Parameters:
        tests - the tests to run
        validatedPrimitives - the collection of primitives to validate.
        formerValidatedPrimitives - the last collection of primitives being validated. May be null.
      • ValidationTask

        public ValidationTask​(java.util.function.Consumer<java.util.List<TestError>> onFinish,
                              ProgressMonitor progressMonitor,
                              java.util.Collection<Test> tests,
                              java.util.Collection<OsmPrimitive> validatedPrimitives,
                              java.util.Collection<OsmPrimitive> formerValidatedPrimitives,
                              boolean beforeUpload)
        Constructs a new ValidationTask
        Parameters:
        onFinish - called when the tests are finished
        progressMonitor - the progress monitor to update with test progress
        tests - the tests to run
        validatedPrimitives - the collection of primitives to validate.
        formerValidatedPrimitives - the last collection of primitives being validated. May be null.
        beforeUpload - true if this is being run prior to upload
        Since:
        18752
    • Method Detail

      • getRelevantParents

        private static java.util.Set<OsmPrimitivegetRelevantParents​(java.util.Collection<OsmPrimitive> primitives)
        Find objects parent objects of given objects which should be checked for geometry problems or mismatches between child tags and parent tags.
        Parameters:
        primitives - the given objects
        Returns:
        the collection of relevant parent objects
      • finish

        protected void finish()
        Description copied from class: PleaseWaitRunnable
        Finish up the data work. Is guaranteed to be called if realRun is called. Finish is called in the gui thread just after the dialog disappeared.
        Specified by:
        finish in class PleaseWaitRunnable
      • realRun

        protected void realRun()
        Description copied from class: PleaseWaitRunnable
        Called in the worker thread to do the actual work. When any of the exception is thrown, a message box will be displayed and closeDialog is called. finish() is called in any case.
        Specified by:
        realRun in class PleaseWaitRunnable
      • getErrors

        public java.util.List<TestErrorgetErrors()
        Gets the validation errors accumulated until this moment.
        Returns:
        The list of errors
      • setTestConsumer

        public void setTestConsumer​(java.util.function.BiConsumer<ValidationTask,​Test> testConsumer)
        A test consumer to avoid filling up memory. A test consumer may remove tests it has consumed.
        Parameters:
        testConsumer - The consumer which takes a ValidationTask (this) and the test that finished.
        Since:
        18752