Class IdUtils

    • Method Detail

      • generateLongId

        public static long generateLongId()
        Generates an unique long identifier.
      • generateId

        public static String generateId​(String s,
                                        String wordSeparator,
                                        boolean lower,
                                        int maxChars)
        Generates an id from a non-null String.

        Replaces accented characters from a string by their ascii equivalent, removes non alphanumerical characters and replaces spaces by the given wordSeparator character.

        s - the original String
        wordSeparator - the word separator to use (usually '-')
        lower - if lower is true, remove upper case
        maxChars - maximum longer of identifier characters
        the identifier String
      • isValidUUID

        public static boolean isValidUUID​(String uuid)
        Check if a given string has the pattern for UUID type 4