Class IDs


  • public final class IDs
    extends Object
    Validations for "ID" like simple types.
    Author:
    Michael Vorburger.ch
    • Method Detail

      • checkOnlyLowercaseAZ09

        public static void checkOnlyLowercaseAZ09​(String id)
        Validate that ID matches regular expression [a-z][a-z0-9]* (lower case letter or digits, but not start with digit, no dots).
        Throws:
        IllegalArgumentException - if not matching expected reg exp.
      • checkOnlyAZ09

        public static void checkOnlyAZ09​(String id)
        Validate that ID matches regular expression [a-zA-Z][a-zA-Z0-9]* (upper or lower case letter or digits, but not start with digit, no dots).
        Throws:
        IllegalArgumentException - if not matching expected reg exp.
      • checkOnlyAZ09Underscore

        public static void checkOnlyAZ09Underscore​(String id)
        Validate that ID matches regular expression [a-zA-Z][a-zA-Z0-9_]* (underscores allowed, but not starting with; no dots).
        Throws:
        IllegalArgumentException - if not matching expected reg exp.
      • checkOnlyAZ09Dot

        public static void checkOnlyAZ09Dot​(String id)
        Validate that ID matches regular expression [a-zA-Z0-9][a-zA-Z0-9.]* (dots allowed, but not starting with).
        Throws:
        IllegalArgumentException - if not matching expected reg exp.
      • check

        public static void check​(String id,
                                 Pattern regexp)
        Validate that ID matches regexp Pattern passed as argument.
        Throws:
        IllegalArgumentException - if not matching expected reg exp.