src/Model/Product.java
// Exception handling for entered field values
Exception handling for entered field values
Exception handling for entered field values
public static String productValueExceptions(double prodPrice, int prodStockLevel, int prodMinStockLevel, int prodMaxStockLevel, String productValueException) {
        if (prodPrice <= 0) {
            productValueException = productValueException + "\nProduct Price cannot be $0 or negative.";
        }
        if (prodStockLevel < 1) {
            productValueException = productValueException + "\nProduct Stock Level cannot be zero.";
        }
        if (prodStockLevel < prodMinStockLevel) {
            productValueException = productValueException + "\nProduct Stock Level must be greater than its Minimum Stock Level requirement.";
        }
        if (prodStockLevel > prodMaxStockLevel) {
            productValueException = productValueException + "\nProduct Stock Level must be less than its Maximum Stock Level requirement.";
        }
        if (prodMinStockLevel > prodMaxStockLevel) {
            productValueException = productValueException + "\nProduct Minimum Stock Level cannot be greater than its Maximum Stock Level.";
        }
        return productValueException;
    }
public static String productValueExceptions ( double prodPrice , int prodStockLevel , int prodMinStockLevel , int prodMaxStockLevel , String productValueException ) { if ( prodPrice <= 0 ) { productValueException = productValueException + "\nProduct Price cannot be $0 or negative." ; } if ( prodStockLevel < 1 ) { productValueException = productValueException + "\nProduct Stock Level cannot be zero." ; } if ( prodStockLevel < prodMinStockLevel ) { productValueException = productValueException + "\nProduct Stock Level must be greater than its Minimum Stock Level requirement." ; } if ( prodStockLevel > prodMaxStockLevel ) { productValueException = productValueException + "\nProduct Stock Level must be less than its Maximum Stock Level requirement." ; } if ( prodMinStockLevel > prodMaxStockLevel ) { productValueException = productValueException + "\nProduct Minimum Stock Level cannot be greater than its Maximum Stock Level." ; } return productValueException ; }
Exception handling for entered field values
Exception handling for entered field values