Package teammates.exception

Examples of teammates.exception.CourseInputInvalidException


  public void addCourse(String ID, String name, String coordinatorID) throws CourseExistsException, CourseInputInvalidException {
    int maxCourseID = 21;
    int maxCourseName = 38;

    if (ID.isEmpty() || name.isEmpty()) {
      throw new CourseInputInvalidException("Empty input fields.");

    } else if (ID.length() > maxCourseID) {
      throw new CourseInputInvalidException("Course ID is too long.");

    } else if (name.length() > maxCourseName) {
      throw new CourseInputInvalidException("Course name is too long");

    } else if (!ID.matches("^[a-zA-Z_$0-9.-]+$")) {
      throw new CourseInputInvalidException("Invalid course name with special characters.");
   
    } else if (getCourse(ID) != null) {
      throw new CourseExistsException();
    }
View Full Code Here

TOP

Related Classes of teammates.exception.CourseInputInvalidException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.