@Override public Object decode(Object jv) { if (jv instanceof Number) { return ((Number) jv).byteValue(); } return (byte) 0; } };
@Override public Object decode(Object jv) { if (jv instanceof Number) { return ((Number) jv).byteValue(); } return (byte) 0; } };
/** * 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.byteValue(); }
/** * Constructs a new MutableByte with the specified value. * * @param value the initial value to store, not null * @throws NullPointerException if the object is null */ public MutableByte(final Number value) { super(); this.value = value.byteValue(); }
/** * 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.byteValue(); }
/** * 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.byteValue(); }
/** * 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 byte addAndGet(final Number operand) { this.value += operand.byteValue(); return value; }
@Override public Object decode(Object jv) { if (jv instanceof Number) { return Byte.valueOf(((Number) jv).byteValue()); } return (Byte) null; } };
@Override public Object decode(Object jv) { if (jv instanceof Number) { return Byte.valueOf(((Number) jv).byteValue()); } return (Byte) null; } };
public static Byte castToByte(Object val) { if (val == null) { return null; } if (val instanceof Byte) { return (Byte) val; } if (val instanceof String) { return Byte.parseByte((String) val); } return ((Number) val).byteValue(); }
@Override public byte getByte(int columnIndex) throws SQLException { Number number = (Number) getObject(columnIndex); if (number == null) { return 0; } return number.byteValue(); }
@Override public byte getByte(int columnIndex) throws SQLException { Number number = (Number) getObject(columnIndex); if (number == null) { return 0; } return number.byteValue(); }
public byte getParameter(String key, byte defaultValue) { Number n = getNumbers().get(key); if (n != null) { return n.byteValue(); } String value = getParameter(key); if (StringUtils.isEmpty(value)) { return defaultValue; } byte b = Byte.parseByte(value); getNumbers().put(key, b); return b; }
public byte getParameter(String key, byte defaultValue) { Number n = getNumbers().get(key); if (n != null) { return n.byteValue(); } String value = getParameter(key); if (StringUtils.isEmpty(value)) { return defaultValue; } byte b = Byte.parseByte(value); getNumbers().put(key, b); return b; }
public byte getMethodParameter(String method, String key, byte defaultValue) { String methodKey = method + "." + key; Number n = getNumbers().get(methodKey); if (n != null) { return n.byteValue(); } String value = getMethodParameter(method, key); if (StringUtils.isEmpty(value)) { return defaultValue; } byte b = Byte.parseByte(value); getNumbers().put(methodKey, b); return b; }
public byte getMethodParameter(String method, String key, byte defaultValue) { String methodKey = method + "." + key; Number n = getNumbers().get(methodKey); if (n != null) { return n.byteValue(); } String value = getMethodParameter(method, key); if (StringUtils.isEmpty(value)) { return defaultValue; } byte b = Byte.parseByte(value); getNumbers().put(methodKey, b); return b; }
@Override public byte getByte(String columnLabel) throws SQLException { return toNumber(column(columnLabel)).byteValue(); }
@Override public byte getByte(int columnIndex) throws SQLException { return toNumber(column(columnIndex)).byteValue(); }
protected final byte _parseBytePrimitive(JsonParser p, DeserializationContext ctxt) throws IOException { int value = _parseIntPrimitive(p, ctxt); // So far so good: but does it fit? if (_byteOverflow(value)) { Number v = (Number) ctxt.handleWeirdStringValue(_valueClass, String.valueOf(value), "overflow, value cannot be represented as 8-bit value"); return _nonNullNumber(v).byteValue(); } return (byte) value; }
protected final byte _parseBytePrimitive(JsonParser p, DeserializationContext ctxt) throws IOException { int value = _parseIntPrimitive(p, ctxt); // So far so good: but does it fit? if (_byteOverflow(value)) { Number v = (Number) ctxt.handleWeirdStringValue(_valueClass, String.valueOf(value), "overflow, value cannot be represented as 8-bit value"); return _nonNullNumber(v).byteValue(); } return (byte) value; }