I have two sets of Products
public enum ProductType {
FOUNDATION_OR_PAYMENT ("946", "949", "966"),
NOVA_L_S_OR_SESAM ("907", "222");
private String[] type;
ProductType(String... type) {
this.type = type;
}
}
Then given a value"actualProductType" I need to check if it is part of the productType ..How do I do this ..
isAnyProductTypes(requestData.getProductType(), ProductType.NOVA_L_S_SESAM)
public boolean isAnyProductTypes(String actualProductType, ProductType productTypes) {
return Arrays.stream(productTypes).anyMatch(productType -> productType.equals(actualProductType));
}
I get an error at this part Arrays.stream(productTypes)