class NumberFieldActions implements AtlasFieldAction {

    @AtlasActionProcessor
    public static Number multiply(Multiply multiply, List<Number> inputs) {
        if (inputs == null) {
            return 0;
        }

        Number product = 1L;
        for (Object entry : inputs) {
            if (entry instanceof Number) {
                if (product instanceof BigDecimal) {
                    product = ((BigDecimal) product).multiply(BigDecimal.valueOf(((Number) entry).doubleValue()));
                } else if (entry instanceof BigDecimal) {
                    product = BigDecimal.valueOf(product.doubleValue()).multiply((BigDecimal) entry);
                } else if (requiresDoubleResult(product) || requiresDoubleResult(entry)) {
                    product = product.doubleValue() * ((Number) entry).doubleValue();
                } else {
                    product = product.longValue() * ((Number) entry).longValue();
                }
            } else {
                warnIgnoringValue("Multiply", entry);
            }
        }

        return product;
    }

}