Sync repo files to b22

This commit is contained in:
HaHaWTH
2023-09-20 02:15:22 +08:00
parent ed320196fe
commit 3f6a7ce48f
478 changed files with 94676 additions and 0 deletions
@@ -0,0 +1,27 @@
package fr.xephi.authme.util;
import java.util.UUID;
/**
* Utility class for various operations on UUID.
*/
public final class UuidUtils {
// Utility class
private UuidUtils() {
}
/**
* Returns the given string as an UUID or null.
*
* @param string the uuid to parse
* @return parsed UUID if succeeded or null
*/
public static UUID parseUuidSafely(String string) {
try {
return string == null ? null : UUID.fromString(string);
} catch (IllegalArgumentException ex) {
return null;
}
}
}