@Test public void testConstruct() throws Exception { Assert.assertEquals(RANDOM_UUID, UUIDUtils.constructUUID(RANDOM_STRIPPED_UUID)); }
public static UUID constructUUID(@Nonnull String uuid) { Preconditions.checkNotNull(uuid, "uuid cannot be null."); Preconditions.checkArgument(uuid.length() == 32 || uuid.length() == 36, "uuid has an unexpected length of " + uuid.length()); if (uuid.length() == 32) { uuid = uuid.replaceAll("(\\w{8})(\\w{4})(\\w{4})(\\w{4})(\\w{12})", "$1-$2-$3-$4-$5"); } return UUID.fromString(uuid); }
UUIDUtils { public static UUID constructUUID(@Nonnull String uuid) { Preconditions.checkNotNull(uuid, "uuid cannot be null."); Preconditions.checkArgument(uuid.length() == 32 || uuid.length() == 36, "uuid has an unexpected length of " + uuid.length()); if (uuid.length() == 32) { uuid = uuid.replaceAll("(\\w{8})(\\w{4})(\\w{4})(\\w{4})(\\w{12})", "$1-$2-$3-$4-$5"); } return UUID.fromString(uuid); } }
UUIDUtils { public static UUID constructUUID(@Nonnull String uuid) { Preconditions.checkNotNull(uuid, "uuid cannot be null."); Preconditions.checkArgument(uuid.length() == 32 || uuid.length() == 36, "uuid has an unexpected length of " + uuid.length()); if (uuid.length() == 32) { uuid = uuid.replaceAll("(\\w{8})(\\w{4})(\\w{4})(\\w{4})(\\w{12})", "$1-$2-$3-$4-$5"); } return UUID.fromString(uuid); } private  UUIDUtils(); }
UUIDUtils { public static UUID constructUUID(@Nonnull String uuid) { Preconditions.checkNotNull(uuid, "uuid cannot be null."); Preconditions.checkArgument(uuid.length() == 32 || uuid.length() == 36, "uuid has an unexpected length of " + uuid.length()); if (uuid.length() == 32) { uuid = uuid.replaceAll("(\\w{8})(\\w{4})(\\w{4})(\\w{4})(\\w{12})", "$1-$2-$3-$4-$5"); } return UUID.fromString(uuid); } private  UUIDUtils(); static String stripHyphens(@Nullable UUID uuid); static String stripHyphens(@Nullable String uuid); static UUID constructUUID(@Nonnull String uuid); }
UUIDUtils { public static UUID constructUUID(@Nonnull String uuid) { Preconditions.checkNotNull(uuid, "uuid cannot be null."); Preconditions.checkArgument(uuid.length() == 32 || uuid.length() == 36, "uuid has an unexpected length of " + uuid.length()); if (uuid.length() == 32) { uuid = uuid.replaceAll("(\\w{8})(\\w{4})(\\w{4})(\\w{4})(\\w{12})", "$1-$2-$3-$4-$5"); } return UUID.fromString(uuid); } private  UUIDUtils(); static String stripHyphens(@Nullable UUID uuid); static String stripHyphens(@Nullable String uuid); static UUID constructUUID(@Nonnull String uuid);  }