src/main/java/com/googlecode/objectify/impl/translate/FloatTranslatorFactory.java
private Number coerceNumber(final Number value, final Class<?> type) {
		if (type == Float.class) return value.floatValue();
		else if (type == Double.class) return value.doubleValue();
		else throw new IllegalArgumentException();	// should be impossible
	}
private Number coerceNumber(final Number value, final Class<?> type) {
		if (type == Float.class) return value.floatValue();
		else if (type == Double.class) return value.doubleValue();
		else throw new IllegalArgumentException();	// should be impossible
	}
private Number coerceNumber ( final Number value , final Class < ? > type ) { if ( type == Float . class ) return value . floatValue ( ) ; else if ( type == Double . class ) return value . doubleValue ( ) ; else throw new IllegalArgumentException ( ) ; // should be impossible }
Coerces the value to be a number of the specified type; needed because
all numbers come back from the datastore as Long/Double and this screws up
any type that expects something smaller. We don't need to worry about primitive
types because we wrapped the class earlier.
Coerces the value to be a number of the specified type ; needed because all numbers come back from the datastore as Long / Double and this screws up any type that expects something smaller . We don t need to worry about primitive types because we wrapped the class earlier .