class NumberFieldActions implements AtlasFieldAction {

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

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

        MassUnitType fromUnit = convertMassUnit.getFromUnit();
        MassUnitType toUnit = convertMassUnit.getToUnit();
        double rate = massConvertionTable.get(fromUnit).get(toUnit);
        return doMultiply(input, rate);
    }

}