All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.transferwise.tasks.utils.TwTasksUuidUtils Maven / Gradle / Ivy

There is a newer version: 1.43.0
Show newest version
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());
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy