Example usage for com.google.common.primitives UnsignedLong valueOf

List of usage examples for com.google.common.primitives UnsignedLong valueOf

Introduction

In this page you can find the example usage for com.google.common.primitives UnsignedLong valueOf.

Prototype

public static UnsignedLong valueOf(String string, int radix) 

Source Link

Document

Returns an UnsignedLong holding the value of the specified String , parsed as an unsigned long value in the specified radix.

Usage

From source file:org.apache.impala.util.TUniqueIdUtil.java

public static TUniqueId ParseId(String id) {
    String[] splitted = id.split(":");
    if (splitted.length != 2)
        throw new NumberFormatException("Invalid unique id format: " + id);
    return new TUniqueId(UnsignedLong.valueOf(splitted[0], 16).longValue(),
            UnsignedLong.valueOf(splitted[1], 16).longValue());
}

From source file:com.android.tools.swing.util.HexFormatter.java

@Override
public Object stringToValue(String text) throws ParseException {
    try {//from  w  w  w .j a v  a2 s  .co  m
        return UnsignedLong.valueOf(text, 16).bigIntegerValue();
    } catch (NumberFormatException nfe) {
        throw new ParseException(text, 0);
    }
}