/** * Create an <code>unsigned byte</code> * * @throws NumberFormatException If <code>value</code> is not in the range * of an <code>unsigned byte</code> * @see UByte#valueOf(short) */ public static UByte ubyte(long value) throws NumberFormatException { return UByte.valueOf(value); }
/** * Generate a cached value for each byte value. * * @return Array of cached values for UByte. */ private static final UByte[] mkValues() { UByte[] ret = new UByte[256]; for (int i = Byte.MIN_VALUE; i <= Byte.MAX_VALUE; i++) ret[i & MAX_VALUE] = new UByte((byte) i); return ret; }
/** * Get an instance of an <code>unsigned byte</code> * * @throws NumberFormatException If <code>value</code> is not in the range * of an <code>unsigned byte</code> */ public static UByte valueOf(short value) throws NumberFormatException { return valueOfUnchecked(rangeCheck(value)); }
/** * Create an <code>unsigned byte</code> * * @throws NumberFormatException If <code>value</code> is not in the range * of an <code>unsigned byte</code> */ private UByte(short value) throws NumberFormatException { this.value = rangeCheck(value); }
@Override final void set0(BindingSetStatementContext<U> ctx, UByte value) throws SQLException { ctx.statement().setShort(ctx.index(), value.shortValue()); }
/** * Get an instance of an <code>unsigned byte</code> by masking it with * <code>0xFF</code> i.e. <code>(byte) -1</code> becomes * <code>(ubyte) 255</code> */ public static UByte valueOf(byte value) { return valueOfUnchecked((short) (value & MAX_VALUE)); }
@Override final void sqlInline0(BindingSQLContext<U> ctx, UByte value) { ctx.render().sql(value.toString()); }
/** * Create an <code>unsigned byte</code> * * @throws NumberFormatException If <code>value</code> is not in the range * of an <code>unsigned byte</code> */ private UByte(long value) throws NumberFormatException { this.value = rangeCheck(value); }
@Override final void set0(BindingSetSQLOutputContext<U> ctx, UByte value) throws SQLException { ctx.output().writeShort(value.shortValue()); }
/** * Get an instance of an <code>unsigned byte</code> by masking it with * <code>0xFF</code> i.e. <code>(byte) -1</code> becomes * <code>(ubyte) 255</code> */ public static UByte valueOf(byte value) { return valueOfUnchecked((short) (value & MAX_VALUE)); }
@Override public UByte convert(Integer in, Context context) throws Exception { if (in == null) { return null; } return UByte.valueOf(in); } });
/** * Get an instance of an <code>unsigned byte</code> * * @throws NumberFormatException If <code>value</code> is not in the range * of an <code>unsigned byte</code> */ public static UByte valueOf(int value) throws NumberFormatException { return valueOfUnchecked(rangeCheck(value)); }
/** * Create an <code>unsigned byte</code> * * @throws NumberFormatException If <code>value</code> is not in the range * of an <code>unsigned byte</code> */ private UByte(long value) throws NumberFormatException { this.value = rangeCheck(value); }
stmt.setShort(nextIndex(), ((UByte) value).shortValue());
/** * Generate a cached value for each byte value. * * @return Array of cached values for UByte. */ private static final UByte[] mkValues() { UByte[] ret = new UByte[256]; for (int i = Byte.MIN_VALUE; i <= Byte.MAX_VALUE; i++) ret[i & MAX_VALUE] = new UByte((byte) i); return ret; }
@Override public UByte convert(Byte in, Context context) throws Exception { if (in == null) { return null; } return UByte.valueOf(in); } });
/** * Get an instance of an <code>unsigned byte</code> * * @throws NumberFormatException If <code>value</code> is not in the range * of an <code>unsigned byte</code> */ public static UByte valueOf(short value) throws NumberFormatException { return valueOfUnchecked(rangeCheck(value)); }
/** * Create an <code>unsigned byte</code> * * @throws NumberFormatException If <code>value</code> is not in the range * of an <code>unsigned byte</code> */ private UByte(int value) throws NumberFormatException { this.value = rangeCheck(value); }
@Override public UByte convert(Integer in, Context context) throws Exception { if (in == null) { return null; } return UByte.valueOf(in); } });
/** * Get an instance of an <code>unsigned byte</code> * * @throws NumberFormatException If <code>value</code> is not in the range * of an <code>unsigned byte</code> */ public static UByte valueOf(long value) throws NumberFormatException { return valueOfUnchecked(rangeCheck(value)); }