@Override public Object decode(Object jv) { if (jv instanceof Number) { return ((Number) jv).shortValue(); } return (short) 0; } };
@Override public Object decode(Object jv) { if (jv instanceof Number) { return ((Number) jv).shortValue(); } return (short) 0; } };
@Override public Character convert(Number source) { return (char) source.shortValue(); }
/** * Adds a value to the value of this instance. * * @param operand the value to add, not null * @throws NullPointerException if the object is null * @since 2.2 */ public void add(final Number operand) { this.value += operand.shortValue(); }
/** * Constructs a new MutableShort with the specified value. * * @param value the initial value to store, not null * @throws NullPointerException if the object is null */ public MutableShort(final Number value) { super(); this.value = value.shortValue(); }
/** * Sets the value from any Number instance. * * @param value the value to set, not null * @throws NullPointerException if the object is null */ @Override public void setValue(final Number value) { this.value = value.shortValue(); }
/** * Subtracts a value from the value of this instance. * * @param operand the value to subtract, not null * @throws NullPointerException if the object is null * @since 2.2 */ public void subtract(final Number operand) { this.value -= operand.shortValue(); }
/** * Increments this instance's value by {@code operand}; this method returns the value associated with the instance * immediately after the addition operation. This method is not thread safe. * * @param operand the quantity to add, not null * @throws NullPointerException if {@code operand} is null * @return the value associated with this instance after adding the operand * @since 3.5 */ public short addAndGet(final Number operand) { this.value += operand.shortValue(); return value; }
@Override public Object decode(Object jv) { if (jv instanceof Number) { return Short.valueOf(((Number) jv).shortValue()); } return (Short) null; } };
@Override public Object decode(Object jv) { if (jv instanceof Number) { return Short.valueOf(((Number) jv).shortValue()); } return (Short) null; } };
public static Short castToShort(Object val) { if (val == null || val == EVAL_VALUE_NULL) { return null; } if (val instanceof Short) { return (Short) val; } if (val instanceof String) { return Short.parseShort((String) val); } return ((Number) val).shortValue(); }
@Override public short getShort(int columnIndex) throws SQLException { Number number = (Number) getObject(columnIndex); if (number == null) { return 0; } return number.shortValue(); }
@Override public short getShort(int columnIndex) throws SQLException { Number number = (Number) getObject(columnIndex); if (number == null) { return 0; } return number.shortValue(); }
public short getParameter(String key, short defaultValue) { Number n = getNumbers().get(key); if (n != null) { return n.shortValue(); } String value = getParameter(key); if (StringUtils.isEmpty(value)) { return defaultValue; } short s = Short.parseShort(value); getNumbers().put(key, s); return s; }
public short getParameter(String key, short defaultValue) { Number n = getNumbers().get(key); if (n != null) { return n.shortValue(); } String value = getParameter(key); if (StringUtils.isEmpty(value)) { return defaultValue; } short s = Short.parseShort(value); getNumbers().put(key, s); return s; }
public short getMethodParameter(String method, String key, short defaultValue) { String methodKey = method + "." + key; Number n = getNumbers().get(methodKey); if (n != null) { return n.shortValue(); } String value = getMethodParameter(method, key); if (StringUtils.isEmpty(value)) { return defaultValue; } short s = Short.parseShort(value); getNumbers().put(methodKey, s); return s; }
public short getMethodParameter(String method, String key, short defaultValue) { String methodKey = method + "." + key; Number n = getNumbers().get(methodKey); if (n != null) { return n.shortValue(); } String value = getMethodParameter(method, key); if (StringUtils.isEmpty(value)) { return defaultValue; } short s = Short.parseShort(value); getNumbers().put(methodKey, s); return s; }
@Override public short getShort(int columnIndex) throws SQLException { return toNumber(column(columnIndex)).shortValue(); }
@Override public short getShort(String columnLabel) throws SQLException { return toNumber(column(columnLabel)).shortValue(); }
protected final short _parseShortPrimitive(JsonParser p, DeserializationContext ctxt) throws IOException { int value = _parseIntPrimitive(p, ctxt); // So far so good: but does it fit? if (_shortOverflow(value)) { Number v = (Number) ctxt.handleWeirdStringValue(_valueClass, String.valueOf(value), "overflow, value cannot be represented as 16-bit value"); return _nonNullNumber(v).shortValue(); } return (short) value; }