class NumberFieldActions implements AtlasFieldAction {

    @AtlasActionProcessor
    public static Number convertVolumeUnit(ConvertVolumeUnit convertVolumeUnit, Number input) {
        if (input == null) {
            return 0;
        }

        if (convertVolumeUnit == null || convertVolumeUnit.getFromUnit() == null
                || convertVolumeUnit.getToUnit() == null) {
            throw new IllegalArgumentException("ConvertVolumeUnit must be specified  with fromUnit and toUnit");
        }

        VolumeUnitType fromUnit = convertVolumeUnit.getFromUnit();
        VolumeUnitType toUnit = convertVolumeUnit.getToUnit();
        double rate = volumeConvertionTable.get(fromUnit).get(toUnit);
        return doMultiply(input, rate);
    }

}