Class ConditionalKeys

    • Constructor Detail

      • ConditionalKeys

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

      • initialize

        public void initialize()
                        throws java.lang.Exception
        Description copied from class: Test
        Initializes any global data used this tester.
        Overrides:
        initialize in class Test
        Throws:
        java.lang.Exception - When cannot initialize the test
      • isRestrictionType

        public static boolean isRestrictionType​(java.lang.String part)
        Check if the key is a key for an access restriction
        Parameters:
        part - The key (or the restriction part of it, e.g. for lanes)
        Returns:
        true if it is a restriction
      • isRestrictionValue

        public static boolean isRestrictionValue​(java.lang.String part)
        Check if the value is a valid restriction value
        Parameters:
        part - The value
        Returns:
        true for allowed restriction values
      • isTransportationMode

        public static boolean isTransportationMode​(java.lang.String part)
        Checks if the key denotes a transport access mode restriction
        Parameters:
        part - The key (or the restriction part of it, e.g. for lanes)
        Returns:
        true if it is a restriction
      • isDirection

        public static boolean isDirection​(java.lang.String part)
        Check if a key part is a valid direction
        Parameters:
        part - The part of the key
        Returns:
        true if it is a direction
      • isKeyValid

        public boolean isKeyValid​(java.lang.String key)
        Checks if a given key is a valid access key
        Parameters:
        key - The conditional key
        Returns:
        true if the key is valid
      • isKeyValid3Parts

        private static boolean isKeyValid3Parts​(java.lang.String... parts)
      • isKeyValid2Parts

        private static boolean isKeyValid2Parts​(java.lang.String... parts)
      • isKeyValid1Part

        private static boolean isKeyValid1Part​(java.lang.String... parts)
      • isValueValid

        public boolean isValueValid​(java.lang.String key,
                                    java.lang.String value)
        Check if a value is valid
        Parameters:
        key - The key the value is for
        value - The value
        Returns:
        true if it is valid
      • validateValue

        public java.lang.String validateValue​(java.lang.String key,
                                              java.lang.String value)
        Validate a key/value pair
        Parameters:
        key - The key
        value - The value
        Returns:
        The error message for that value or null to indicate valid
      • validatePrimitive

        public java.util.List<TestErrorvalidatePrimitive​(OsmPrimitive p)
        Validate a primitive
        Parameters:
        p - The primitive
        Returns:
        The errors for that primitive or an empty list if there are no errors.