blob: a24b4819d7bfef500d98aea05a2aa7410b3eeefc (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.document.select.parser;
import com.yahoo.javacc.UnicodeUtilities;
import java.math.BigInteger;
/**
* @author Simon Thoresen Hult
*/
public class SelectParserUtils {
static long decodeLong(String str) {
if (str.startsWith("0x") || str.startsWith("0X")) {
str = Long.toString(new BigInteger(str.substring(2), 16).longValue());
}
return Long.decode(str);
}
public static String quote(String str, char quote) {
return UnicodeUtilities.quote(str, quote);
}
public static String unquote(String str) {
return UnicodeUtilities.unquote(str);
}
}
|