* This method is used to get the whether the sizes are out of stock or
* present in the database if present the sizes are shown
* @return string
*/
publicStringshowSizes(){
returnoutOfStock()?"* Out of Stock *":"Sizes available : "+size.entrySet().stream().map(size->size.getKey()+"-"+size.getValue()).reduce((sizes,size)->sizes+", "+size).get();
}
/**
* This method is used to get the menu of the product according to the required
StringcategoryOptions=Arrays.stream(Category.values()).filter(category->!category.equals(Category.EXIT)).map(category->"("+category.getOption()+")"+category).reduce((categories,category)->categories+" "+category).get()+"\nPress 0 to go back.";
if(check){
...
...
@@ -30,6 +45,12 @@ public final class Utility {
});
}
/**
* This static method is used to get the Sizes of the given input option of the message
StringcategoryOptions=Arrays.stream(Size.values()).filter(size->!size.equals(Size.EXIT)).map(size->"("+size.getOption()+")"+size).reduce((sizes,size)->sizes+" "+size).get()+"\nPress 0 to go back.";
if(check){
...
...
@@ -42,6 +63,12 @@ public final class Utility {
});
}
/**
* This method is used to get the gender details of the given input option
StringgenderOptions=Arrays.stream(Gender.values()).filter(gender->!gender.equals(Gender.EXIT)).map(gender->"("+gender.getOption()+")"+gender).reduce((genders,gender)->genders+" "+gender).get()+"\nPress 0 to go back.";
if(check){
...
...
@@ -54,6 +81,12 @@ public final class Utility {
});
}
/**
* This method is used to get all the colors of the given input option
StringcolorOptions=Arrays.stream(Color.values()).filter(color->!color.equals(Color.EXIT)).map(color->"("+color.getOption()+")"+color).reduce((categories,category)->categories+" "+category).get()+"\nPress 0 to go back.";
if(check){
...
...
@@ -66,6 +99,13 @@ public final class Utility {
});
}
/**
* This method is used to get the message as per invalid option if
* you enter other options or other input than shown there.