public final class NumberUtils extends Object
Modifier and Type | Field and Description |
---|---|
static List<Class<?>> |
NUMERIC_PRIMITIVE_CLASSES
|
Modifier and Type | Method and Description |
---|---|
static List<Integer> |
asList(int... values) |
static int |
diffOffset(byte[] a1,
int startPos1,
byte[] a2,
int startPos2,
int len) |
static byte[] |
emptyIfNull(byte[] a) |
static int |
getNextPowerOf2(int value) |
static int |
hashCode(byte... values) |
static int |
hashCode(byte[] a,
int offset,
int len) |
static int |
hashCode(int... values) |
static int |
hashCode(long... values) |
static boolean |
isEmpty(byte[] a) |
static boolean |
isEmpty(int[] a) |
static boolean |
isEmpty(long[] a) |
static boolean |
isIntegerNumber(CharSequence cs)
Checks if optional sign and all others are '0'-'9'
|
static boolean |
isNumericClass(Class<?> clazz) |
static String |
join(char separator,
boolean unsigned,
byte... values) |
static String |
join(char separator,
int... values) |
static String |
join(char separator,
long... values) |
static String |
join(CharSequence separator,
boolean unsigned,
byte... values) |
static String |
join(CharSequence separator,
int... values) |
static String |
join(CharSequence separator,
long... values) |
static int |
length(byte... a) |
static int |
length(int... a) |
static int |
length(long... a) |
static Integer |
toInteger(Number n)
|
public static int getNextPowerOf2(int value)
value
- The original (non-negative) valuepublic static int hashCode(long... values)
public static int hashCode(int... values)
public static int hashCode(byte... values)
public static int hashCode(byte[] a, int offset, int len)
public static int diffOffset(byte[] a1, int startPos1, byte[] a2, int startPos2, int len)
public static boolean isNumericClass(Class<?> clazz)
clazz
- The Class
to examine - ignored if null
Number
or one of the primitive numerical typesNUMERIC_PRIMITIVE_CLASSES
public static String join(CharSequence separator, long... values)
public static String join(char separator, long... values)
public static String join(CharSequence separator, boolean unsigned, byte... values)
public static String join(char separator, boolean unsigned, byte... values)
public static String join(CharSequence separator, int... values)
public static String join(char separator, int... values)
public static byte[] emptyIfNull(byte[] a)
public static boolean isEmpty(byte[] a)
public static boolean isEmpty(int[] a)
public static boolean isEmpty(long[] a)
public static int length(byte... a)
public static int length(int... a)
public static int length(long... a)
public static boolean isIntegerNumber(CharSequence cs)
cs
- The CharSequence
to checktrue
if valid integer numberCopyright © 2008–2022 The Apache Software Foundation. All rights reserved.