package policy; public enum ProductPriceLevel { ProductLine(1), Product(2),SKU(3); private int level; private ProductPriceLevel(int level) { this.level = level; } public int getLevel() { return level; } public static ProductPriceLevel parseTypeCode(String typeCode) { if (typeCode == null) { return SKU; } typeCode = typeCode.toLowerCase(); if ("customer-productline-price".equals(typeCode)) { return ProductLine; } else if ("customer-product-price".equals(typeCode)) { return Product; } else if ("standard-sku-price".equals(typeCode) || "Customer-sku-Price".equals(typeCode)) { return SKU; } return SKU; } }