Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package FootbalTeamGenerator;
- public class Validator {
- public static boolean statIsValid(int stat){
- if (stat < 0 || stat > 100){
- throw new IllegalArgumentException(" should be between 0 and 100.");
- }
- return true;
- }
- public static boolean nameIsValid(String name){
- if (name.trim()==null || name.trim().isEmpty()){
- throw new IllegalArgumentException
- ("A name should not be empty.");
- }
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement