@Override public ULong convert(Long in, Context context) throws Exception { if (in == null) { return null; } return ULong.valueOf(in); } });
/** * Create an <code>unsigned long</code> by masking it with * <code>0xFFFFFFFFFFFFFFFF</code> i.e. <code>(long) -1</code> becomes * <code>(uint) 18446744073709551615</code> * * @see ULong#valueOf(long) */ public static ULong ulong(long value) { return ULong.valueOf(value); }
/** * Create an <code>unsigned long</code> by masking it with * <code>0xFFFFFFFFFFFFFFFF</code> i.e. <code>(long) -1</code> becomes * <code>(uint) 18446744073709551615</code> * * @see ULong#valueOf(long) */ public static ULong ulong(long value) { return ULong.valueOf(value); }
/** * Create an <code>unsigned long</code> * * @throws NumberFormatException If <code>value</code> does not contain a * parsable <code>unsigned long</code>. * @see ULong#valueOf(String) */ public static ULong ulong(String value) throws NumberFormatException { return value == null ? null : ULong.valueOf(value); }
/** * Create an <code>unsigned long</code> * * @throws NumberFormatException If <code>value</code> is not in the range * of an <code>unsigned long</code> * @see ULong#valueOf(BigInteger) */ public static ULong ulong(BigInteger value) throws NumberFormatException { return ULong.valueOf(value); }
@Override public ULong convert(BigInteger in, Context context) throws Exception { if (in == null) { return null; } return ULong.valueOf(in); } });
@Override public ULong convert(BigInteger in, Context context) throws Exception { if (in == null) { return null; } return ULong.valueOf(in); } });
@Override public ULong convert(Long in, Context context) throws Exception { if (in == null) { return null; } return ULong.valueOf(in); } });
/** * Create an <code>unsigned long</code> * * @throws NumberFormatException If <code>value</code> does not contain a * parsable <code>unsigned long</code>. * @see ULong#valueOf(String) */ public static ULong ulong(String value) throws NumberFormatException { return value == null ? null : ULong.valueOf(value); }
/** * Create an <code>unsigned long</code> * * @throws NumberFormatException If <code>value</code> is not in the range * of an <code>unsigned long</code> * @see ULong#valueOf(BigInteger) */ public static ULong ulong(BigInteger value) throws NumberFormatException { return ULong.valueOf(value); }
public ULong add(ULong val) throws NumberFormatException { if (value < 0 && val.value < 0) throw new NumberFormatException(); final long result = value + val.value; if ((value < 0 || val.value < 0) && result >= 0) throw new NumberFormatException(); return valueOf(result); }
public ULong subtract(final ULong val) { if (this.compareTo(val) < 0) throw new NumberFormatException(); final long result = value - val.value; if (value < 0 && result >= 0) throw new NumberFormatException(); return valueOf(result); }
public ULong add(long val) throws NumberFormatException { if (val < 0) return subtract(Math.abs(val)); final long result = value + val; if (value < 0 && result >= 0) throw new NumberFormatException(); return valueOf(result); }
@Override public ScalarMongoTimestamp toValue(Long value) { BigInteger bigValue = ULong.valueOf(value).toBigInteger(); return new DefaultScalarMongoTimestamp(bigValue.shiftRight(32).intValue(), bigValue.shiftLeft(32).shiftRight(32).intValue()); }
public ULong subtract(final long val) { if (val < 0) return add(-val); if (compare(value, val) < 0) throw new NumberFormatException(); final long result = value - val; if (value < 0 && result >= 0) throw new NumberFormatException(); return valueOf(result); } }
@Override public ULong to(ScalarMongoTimestamp userObject) { return ULong.valueOf(BigInteger.valueOf(userObject.getSecondsSinceEpoch()).shiftLeft(32).add(BigInteger.valueOf(userObject.getOrdinal()))); }
@Override public String toJsonLiteral(ScalarMongoTimestamp value) { return ULong.valueOf(BigInteger.valueOf(value.getSecondsSinceEpoch()).shiftLeft(32).add(BigInteger.valueOf(value.getOrdinal()))).toString(); }
@Override final ULong get0(BindingGetStatementContext<U> ctx) throws SQLException { String string = ctx.statement().getString(ctx.index()); return string == null ? null : ULong.valueOf(string); }
@Override final ULong get0(BindingGetSQLInputContext<U> ctx) throws SQLException { String string = ctx.input().readString(); return string == null ? null : ULong.valueOf(string); }
return (T) ULong.valueOf(string);