class CalculPrice {

    public static final double getGenericPrice(double price, double discount, double taxe, int binaryMask) {
        if (hasOption(binaryMask, Type.DISCOUNT_COST)) {
            return getDiscountCost(price, discount);
        }
        if (hasOption(binaryMask, Type.TAXE_COST)) {
            return getTaxCost(price, taxe);
        }
        if (hasOption(binaryMask, Type.DISCOUNT)) {
            price = applyDiscount(price, discount);
        }
        if (hasOption(binaryMask, Type.TAXE)) {
            price = applyTax(price, taxe);
        }
        return price;
    }

}