Java UUID Create generateUUIDFrom(String uuidString)

Here you can find the source of generateUUIDFrom(String uuidString)

Description

generate UUID From

License

Apache License

Declaration

public static final UUID generateUUIDFrom(String uuidString) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.UUID;

public class Main {
    private static final String DELIMITER = "-";

    public static final UUID generateUUIDFrom(String uuidString) {
        // UUID FORMAT : 5bbe204e-7e62-4ab1-ab16-1485dfa07897
        StringBuilder uuidFromString = new StringBuilder(uuidString);
        uuidFromString.insert(8, DELIMITER);
        uuidFromString.insert(13, DELIMITER);
        uuidFromString.insert(18, DELIMITER);
        uuidFromString.insert(23, DELIMITER);
        return UUID.fromString(uuidFromString.toString().toLowerCase());
    }/*from w ww  . j a  v  a  2 s.  co  m*/
}

Related

  1. generateUUID(int numchars)
  2. generateUUID(Object o)
  3. generateUUID(String prefix)
  4. generateUuid(String seed)
  5. generateUUIDFileName(String fileName)
  6. generateUUIDFromString(String uuid)
  7. generateUUIDName(String filename)
  8. generateUUIDRandom()
  9. generateUuidStringStatic()