Class OpeningHourTest

    • Constructor Detail

      • OpeningHourTest

        public OpeningHourTest()
        Constructs a new OpeningHourTest.
    • Method Detail

      • createTestError

        private TestError createTestError​(Severity severity,
                                          java.lang.String message,
                                          java.lang.String key,
                                          java.lang.String value,
                                          java.lang.String prettifiedValue,
                                          OsmPrimitive p)
        Returns the real test error given to JOSM validator.
        Parameters:
        severity - The error severity
        message - The error message
        key - The incriminated key, used for display.
        value - The incriminated value, used for comparison with prettified value.
        prettifiedValue - The prettified value
        p - The incriminated OSM primitive.
        Returns:
        The real test error given to JOSM validator. Can be fixable or not if a prettified values has been determined.
      • checkOpeningHourSyntax

        public java.util.List<TestErrorcheckOpeningHourSyntax​(java.lang.String key,
                                                                java.lang.String value)
        Checks for a correct usage of the opening hour syntax of the value given, and returns a list containing validation errors or an empty list. Null values result in an empty list.
        Parameters:
        key - the OSM key (should be "opening_hours", "collection_times" or "service_times"). Used in error message
        value - the opening hour value to be checked.
        Returns:
        a list of TestError or an empty list
      • checkOpeningHourSyntax

        java.util.List<TestErrorcheckOpeningHourSyntax​(java.lang.String key,
                                                         java.lang.String value,
                                                         OsmPrimitive p,
                                                         java.util.Locale locale)
        Checks for a correct usage of the opening hour syntax of the value given, and returns a list containing validation errors or an empty list. Null values result in an empty list.
        Parameters:
        key - the OSM key (should be "opening_hours", "collection_times" or "service_times").
        value - the opening hour value to be checked.
        p - the primitive to check/fix.
        locale - the locale code used for localizing messages
        Returns:
        a list of TestError or an empty list
      • addErrorsForPrimitive

        public void addErrorsForPrimitive​(OsmPrimitive p,
                                          java.util.Collection<TestError> errors)
        Checks the tags of the given primitive and adds validation errors to the given list.
        Parameters:
        p - The primitive to test
        errors - The list to add validation errors to
        Since:
        17643
      • addGui

        public void addGui​(javax.swing.JPanel testPanel)
        Description copied from class: Test
        Allow the tester to manage its own preferences
        Overrides:
        addGui in class Test
        Parameters:
        testPanel - The panel to add any preferences component
      • ok

        public boolean ok()
        Description copied from class: Test
        Called when the used submits the preferences
        Overrides:
        ok in class Test
        Returns:
        true if restart is required, false otherwise