class NumberFieldActions implements AtlasFieldAction {

    @AtlasActionProcessor
    public static Number absoluteValue(AbsoluteValue action, Number input) {
        if (input == null) {
            return 0;
        }
        if (input instanceof BigDecimal) {
            return ((BigDecimal) input).abs();
        }
        if (requiresDoubleResult(input)) {
            return Math.abs(input.doubleValue());
        }
        return Math.abs(input.longValue());
    }

}