Package com.illumon.iris.libs.primitives
Class PrimitiveParseUtil
java.lang.Object
com.illumon.iris.libs.primitives.PrimitiveParseUtil
public class PrimitiveParseUtil extends Object
A set of commonly used functions for parsing strings to primitive values.
-
Constructor Summary
Constructors Constructor Description PrimitiveParseUtil()
-
Method Summary
Modifier and Type Method Description static Boolean
parseBoolean(String s)
Parses the string argument as aboolean
.static byte
parseByte(String s)
Parses the string argument as abyte
.static byte
parseByte(String s, int radix)
Parses the string argument as abyte
.static double
parseDouble(String s)
Parses the string argument as adouble
.static float
parseFloat(String s)
Parses the string argument as afloat
.static int
parseInt(String s)
Parses the string argument as anint
.static int
parseInt(String s, int radix)
Parses the string argument as anint
.static long
parseLong(String s)
Parses the string argument as along
.static long
parseLong(String s, int radix)
Parses the string argument as along
.static short
parseShort(String s)
Parses the string argument as ashort
.static short
parseShort(String s, int radix)
Parses the string argument as ashort
.static int
parseUnsignedInt(String s)
Parses the string argument as an unsignedint
.static int
parseUnsignedInt(String s, int radix)
Parses the string argument as an unsignedint
.static long
parseUnsignedLong(String s)
Parses the string argument as an unsignedlong
.static long
parseUnsignedLong(String s, int radix)
Parses the string argument as an unsignedlong
.
-
Constructor Details
-
PrimitiveParseUtil
public PrimitiveParseUtil()
-
-
Method Details
-
parseByte
Parses the string argument as abyte
.- Parameters:
s
- string.- Returns:
- parsed value.
-
parseByte
Parses the string argument as abyte
.- Parameters:
s
- string.radix
- The radix to use in parsings
- Returns:
- parsed value.
-
parseShort
Parses the string argument as ashort
.- Parameters:
s
- string.- Returns:
- parsed value.
-
parseShort
Parses the string argument as ashort
.- Parameters:
s
- string.radix
- The radix to use in parsings
- Returns:
- parsed value.
-
parseInt
Parses the string argument as anint
.- Parameters:
s
- string.- Returns:
- parsed value.
-
parseInt
Parses the string argument as anint
.- Parameters:
s
- string.radix
- The radix to use in parsings
- Returns:
- parsed value.
-
parseUnsignedInt
Parses the string argument as an unsignedint
.- Parameters:
s
- string.- Returns:
- parsed value.
-
parseUnsignedInt
Parses the string argument as an unsignedint
.- Parameters:
s
- string.radix
- The radix to use in parsings
- Returns:
- parsed value.
-
parseLong
Parses the string argument as along
.- Parameters:
s
- string.- Returns:
- parsed value.
-
parseLong
Parses the string argument as along
.- Parameters:
s
- string.radix
- The radix to use in parsings
- Returns:
- parsed value.
-
parseUnsignedLong
Parses the string argument as an unsignedlong
.- Parameters:
s
- string.- Returns:
- parsed value.
-
parseUnsignedLong
Parses the string argument as an unsignedlong
.- Parameters:
s
- string.radix
- The radix to use in parsings
- Returns:
- parsed value.
-
parseDouble
Parses the string argument as adouble
.- Parameters:
s
- string.- Returns:
- parsed value.
-
parseFloat
Parses the string argument as afloat
.- Parameters:
s
- string.- Returns:
- parsed value.
-
parseBoolean
Parses the string argument as aboolean
.- Parameters:
s
- string.- Returns:
- parsed value.
-