Java Code Examples for org.apache.commons.lang3.math.NumberUtils#toShort()

The following examples show how to use org.apache.commons.lang3.math.NumberUtils#toShort() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConfigUtils.java    From fastjgame with Apache License 2.0 4 votes vote down vote up
public static short getAsShort(final String str, final short defaultValue) {
    return NumberUtils.toShort(str, defaultValue);
}
 
Example 2
Source File: RedisNumber.java    From azeroth with Apache License 2.0 4 votes vote down vote up
public Short getShort() {
    String value = super.get();
    return value == null ? null : NumberUtils.toShort(value);
}
 
Example 3
Source File: RedisNumber.java    From jeesuite-libs with Apache License 2.0 4 votes vote down vote up
public Short getShort() {
	String value = super.get();
	return value == null ? null : NumberUtils.toShort(value);
}
 
Example 4
Source File: TXT.java    From riiablo with Apache License 2.0 4 votes vote down vote up
public short getShort(int row, int col) {
  String value = getString(row, col);
  return NumberUtils.toShort(value, (short) 0);
}
 
Example 5
Source File: TxtParser.java    From riiablo with Apache License 2.0 4 votes vote down vote up
public short getShort(int i) {
  return NumberUtils.toShort(getString(i));
}