I need to write the implementation of a GameCard class that stores the information corresponding to a card. The class must have 2 private fields: a
String that saves the figure (7, 8, 9, 10, J, Q, K or A) and a String that saves the type of playing card (RED HEART, BLACK HEART, CLOVER or CARO) . The class will have a constructor that receives a String and a String as parameters and throws a GameException exception, also defined by you, if one of the parameters is not part of the variants listed above.
The thrown exception message must be Invalid Figure if the first parameter is invalid, Invalid Type if the second parameter is invalid, or Invalid Figure and Type if none of the above parameters follow the rules.
This is what I tried, but i dont know how to continue:
Copy Code
private List<String> figure = Arrays.asList("7", "8", "9", "10", "J", "Q", "K", "A")
Copy Code
private List<String> type = Arrays.asList("RED HEART", "BLACK HEART", "CLOVER", "CARO")