- java.lang.Object
-
- util.SelectorUtil
-
public class SelectorUtil extends java.lang.Object
TheSelectorUtil
class provides utility methods to select various entities like camps, enquirie, suggestions and schools from a list by getting user input.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Scanner
sc
Scanner
object to get input from the user.
-
Constructor Summary
Constructors Constructor Description SelectorUtil()
Constructs an instance of theSelectorUtil
class
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Camp
campSelector(java.util.ArrayList<Camp> camps)
Selects a camp from a list of camps by getting user input.static Enquiry
enquirySelector(java.util.ArrayList<Enquiry> enquiries)
Selects an enquiry from a list of enquiries by getting user input.static java.util.List<Schools>
schoolSelector()
Selects school(s) from a list of schools by getting user input.static Suggestion
suggestionSelector(java.util.ArrayList<Suggestion> suggestions)
Selects an suggestion from a list of suggestions by getting user input.
-
-
-
Constructor Detail
-
SelectorUtil
public SelectorUtil()
Constructs an instance of theSelectorUtil
class
-
-
Method Detail
-
campSelector
public static Camp campSelector(java.util.ArrayList<Camp> camps)
Selects a camp from a list of camps by getting user input.- Parameters:
camps
- the list of camps- Returns:
- the selected camp or null if no camp is selected
-
enquirySelector
public static Enquiry enquirySelector(java.util.ArrayList<Enquiry> enquiries)
Selects an enquiry from a list of enquiries by getting user input.- Parameters:
enquiries
- the list of enquiries- Returns:
- the selected enquiry or null if no enquiry is selected
-
suggestionSelector
public static Suggestion suggestionSelector(java.util.ArrayList<Suggestion> suggestions)
Selects an suggestion from a list of suggestions by getting user input.- Parameters:
suggestions
- the list of suggestions- Returns:
- the selected suggestion or null if no suggestion is selected
-
schoolSelector
public static java.util.List<Schools> schoolSelector()
Selects school(s) from a list of schools by getting user input.- Returns:
- the list of schools the camp is open to
-
-