class DoubleConverter implements AtlasConverter<Double> {

    @AtlasConversionInfo(sourceType = FieldType.DOUBLE, targetType = FieldType.INTEGER,
            concerns = {AtlasConversionConcern.RANGE, AtlasConversionConcern.FRACTIONAL_PART})
    public Integer toInteger(Double value) throws AtlasConversionException {
        if (value == null) {
            return null;
        }
        if (value < Integer.MIN_VALUE || value > Integer.MAX_VALUE) {
            throw new AtlasConversionException(String.format(
                    "Double %s is greater than Integer.MAX_VALUE or less than Integer.MIN_VALUE", value));
        }
        return value.intValue();
    }

}