* Class used to import the values of the option given in the console and print accordingly
* of the required choice chosen
*/
publicclassUtility{
@Log
publicclassInputUtil{
privatestaticfinalScannerSCANNER=null;
privatestaticfinalLoggerLOGGER=null;
/**
* No argument constructor
*/
privateUtility(){
privateInputUtil(){
}
/**
...
...
@@ -38,11 +39,11 @@ public class Utility {
CategorycategoryValue;
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.";
getLogger().info("\n------------------------\n+Please enter valid category\n------------------------\n"+categoryOptions+"\n------------------------\n");
log.info("\n------------------------\n+Please enter valid category\n------------------------\n"+categoryOptions+"\n------------------------\n");
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.";
getLogger().info("\n------------------------\nPlease enter valid category\n------------------------\n"+categoryOptions+"\n------------------------\n");
log.info("\n------------------------\nPlease enter valid category\n------------------------\n"+categoryOptions+"\n------------------------\n");
returngetSize(false,message);
});
returnsizeValue.equals(Size.EXIT)?null:sizeValue;
...
...
@@ -80,11 +81,11 @@ public class Utility {
GendergenderValue;
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.";
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.";