public Long toLong(Byte self) { return self.longValue(); }
@Override public Long toLong(Object value) { return ((Byte) value).longValue(); }
private Long coerceToLong(Object o) { if(o == null) return null; Class<?> c = o.getClass(); if(c == Long.class) return (Long) o; else if(c == Byte.class) return ((Byte) o).longValue(); else if(c == Short.class) return ((Short) o).longValue(); else if(c == Integer.class) return ((Integer) o).longValue(); else throw new SerializationException("Object of type " + c.getName() + " cannot be coerced to type " + JsonTypes.INT64 + " as the schema specifies."); }
@SuppressWarnings({ "unchecked" }) @Override public <X> X unwrap(Byte value, Class<X> type, WrapperOptions options) { if ( value == null ) { return null; } if ( Byte.class.isAssignableFrom( type ) ) { return (X) value; } if ( Short.class.isAssignableFrom( type ) ) { return (X) Short.valueOf( value.shortValue() ); } if ( Integer.class.isAssignableFrom( type ) ) { return (X) Integer.valueOf( value.intValue() ); } if ( Long.class.isAssignableFrom( type ) ) { return (X) Long.valueOf( value.longValue() ); } if ( Double.class.isAssignableFrom( type ) ) { return (X) Double.valueOf( value.doubleValue() ); } if ( Float.class.isAssignableFrom( type ) ) { return (X) Float.valueOf( value.floatValue() ); } if ( String.class.isAssignableFrom( type ) ) { return (X) value.toString(); } throw unknownUnwrap( type ); } @Override
return (T) (Long) ((Byte) Byte.parseByte(strValue)).longValue();
toEncode = ((Byte) value).longValue();
public Long getLongProperty(final SimpleString key) throws ActiveMQPropertyConversionException { Object value = doGetProperty(key); if (value == null) { return Long.valueOf(null); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof Byte) { return ((Byte) value).longValue(); } else if (value instanceof Short) { return ((Short) value).longValue(); } else if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof SimpleString) { return Long.parseLong(((SimpleString) value).toString()); } throw new ActiveMQPropertyConversionException("Invalid conversion: " + key); }
return new BigDecimal( ( (Byte) value ).longValue() ); } else if ( classType.equalsIgnoreCase( "java.lang.Short" ) ) { return new BigDecimal( ( (Short) value ).longValue() );
return ((Byte)value).longValue();
private String format(Object o) { if (o instanceof Float) { return format(((Float) o).doubleValue()); } else if (o instanceof Double) { return format(((Double) o).doubleValue()); } else if (o instanceof Byte) { return format(((Byte) o).longValue()); } else if (o instanceof Short) { return format(((Short) o).longValue()); } else if (o instanceof Integer) { return format(((Integer) o).longValue()); } else if (o instanceof Long) { return format(((Long) o).longValue()); } return null; } private String format(long n) {
value = ((Short) arg).longValue(); } else if (arg instanceof Byte) { value = ((Byte) arg).longValue(); } else { throw badArgumentType();
} else if ( valueData instanceof Byte ) { valueType = ValueMetaInterface.TYPE_INTEGER; valueData = Long.valueOf( ( (Byte) valueData ).longValue() ); } else if ( valueData instanceof Long ) { valueType = ValueMetaInterface.TYPE_INTEGER;
} else if ( valueData instanceof Byte ) { valueMeta = new ValueMetaInteger( valueName ); valueData = Long.valueOf( ( (Byte) valueData ).longValue() ); } else if ( valueData instanceof Long ) { valueMeta = new ValueMetaInteger( valueName );
case 8: assertTrue(obj instanceof Byte); assertEquals(((Byte) obj).longValue(), casted); break; default:
printLong(((Short) unknown).longValue()); } else if (type == Byte.class) { printLong(((Byte) unknown).longValue()); } else if (type == Boolean.class) { printBoolean((Boolean) unknown);
case ValueMetaInterface.TYPE_INTEGER: if ( classname.equalsIgnoreCase( "java.lang.Byte" ) ) { res.setValue( ( (java.lang.Byte) result ).longValue() ); } else if ( classname.equalsIgnoreCase( "java.lang.Short" ) ) { res.setValue( ( (Short) result ).longValue() );
case ValueMetaInterface.TYPE_INTEGER: if ( classname.equalsIgnoreCase( "java.lang.Byte" ) ) { res.setValue( ( (java.lang.Byte) result ).longValue() ); } else if ( classname.equalsIgnoreCase( "java.lang.Short" ) ) { res.setValue( ( (Short) result ).longValue() );
@Override public byte[] convertObjTypeToCassType(Object value) { BigInteger bigInt; if (value instanceof Byte) { bigInt = BigInteger.valueOf(((Byte) value).longValue()); } else if (value instanceof Short) { bigInt = BigInteger.valueOf(((Short) value).longValue()); } else if (value instanceof Integer) { bigInt = BigInteger.valueOf(((Integer) value).longValue()); } else if (value instanceof Long) { bigInt = BigInteger.valueOf((Long) value); } else if (value instanceof BigInteger) { bigInt = (BigInteger) value; } else { throw new HectorObjectMapperException( "value of type " + value.getClass().getName() + " is not an integer type (in a mathematical context) and cannot be converted to a variable integer type"); } return BigIntegerSerializer.get().toBytes(bigInt); } }
public ScalarExpression newLiteral(QueryExpression qs, Object value) { ScalarExpression expr = new ByteLiteral(qs, this, BigInteger.valueOf(((Byte)value).longValue())); return expr; }
@Override public Long getLong(int index) { if (!isValidLong(index)) { throw new PlcIncompatibleDatatypeException(Long.class, index); } return getValue(index).longValue(); }