com.transferwise.tasks.utils.TwTasksUuidUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tw-tasks-core Show documentation
Show all versions of tw-tasks-core Show documentation
Transferwise Tasks Executor - Fire and forget until Alert.
package com.transferwise.tasks.utils;
import java.math.BigInteger;
import java.util.UUID;
import org.apache.commons.lang3.StringUtils;
public final class TwTasksUuidUtils {
private TwTasksUuidUtils() {
throw new AssertionError();
}
public static UUID toUuid(String st) {
String hyphenlessUuid = StringUtils.remove(st, '-');
BigInteger bigInteger = new BigInteger(hyphenlessUuid, 16);
return new UUID(bigInteger.shiftRight(64).longValue(), bigInteger.longValue());
}
}