// Path: backend/src/main/java/com/github/istin/schedule/backend/adapter/grsu/GrsuAdapter.java
// public class GrsuAdapter implements IUniversityAdapter {
// 
//     public static final String BASE_URL_API = "http://api.grsu.by/1.x/app1/";
//     public static final String LECTURER_LIST_API = BASE_URL_API + "getTeachers?extended=false";
//     public static final String TEACHERS_SCHEDULE_LIST_API = BASE_URL_API + "getTeacherSchedule?teacherId=";
// 
//     @Override
//     public List<Lecturer> getLecturerList() throws Exception {
//         InputStream inputStream = null;
//         InputStreamReader inputStreamReader = null;
//         BufferedReader bufferedReader = null;
//         try {
//             inputStream = HttpUtils.getInputStream(LECTURER_LIST_API);
//             inputStreamReader = new InputStreamReader(inputStream, "UTF-8");
//             bufferedReader = new BufferedReader(inputStreamReader, 8192);
//             final LecturerResponse lecturerList = new Gson().fromJson(bufferedReader, LecturerResponse.class);
//             final List<LecturerModel> lecturers = lecturerList.getLecturers();
//             List<Lecturer> list = new ArrayList<>();
//             if (lecturers != null) {
//                 for (LecturerModel lecturerModel : lecturers) {
//                     final Lecturer lecturer = new Lecturer();
//                     lecturer.setId(lecturerModel.getId());
//                     lecturer.setName(lecturerModel.getFullName());
//                     list.add(lecturer);
//                 }
//             }
//             return list;
// 
//         } catch (IOException e) {
//             e.printStackTrace();
//         } finally {
//             HttpUtils.close(inputStream);
//             HttpUtils.close(inputStreamReader);
//             HttpUtils.close(bufferedReader);
//         }
// 
//         return new ArrayList<>();
//     }
// 
//     @Override
//     public List<Lesson> getLecturerScheduleList(String pLid) throws Exception {
//         InputStream inputStream = null;
//         InputStreamReader inputStreamReader = null;
//         BufferedReader bufferedReader = null;
//         try {
//             inputStream = HttpUtils.getInputStream(TEACHERS_SCHEDULE_LIST_API+pLid);
//             inputStreamReader = new InputStreamReader(inputStream, "UTF-8");
//             bufferedReader = new BufferedReader(inputStreamReader, 8192);
//             final LessonsResponse scheduleList = new Gson().fromJson(bufferedReader, LessonsResponse.class);
//             final List<LessonModel> lessons = scheduleList.getLessons();
//             List<Lesson> list = new ArrayList<>();
//             if (lessons != null) {
//                 for (LessonModel lessonModel : lessons) {
//                     list.add(lessonModel.doOptimize());
//                 }
//             }
//             return list;
// 
//         } catch (IOException e) {
//             e.printStackTrace();
//         } finally {
//             HttpUtils.close(inputStream);
//             HttpUtils.close(inputStreamReader);
//             HttpUtils.close(bufferedReader);
//         }
// 
//         return new ArrayList<>();
//     }
// }


import com.github.istin.schedule.backend.adapter.grsu.GrsuAdapter;
package com.github.istin.schedule.backend;


/**
 * Created by uladzimir_klyshevich on 10/12/15.
 */
public enum University {

    GRSU("ГрГУ", new GrsuAdapter()),
    GR_MED_UNIVER("Гродненский Мед. университет", new GrsuAdapter());

    private String mName;

    private IUniversityAdapter mUniversityAdapter;

    University(String pName, IUniversityAdapter pUniversityAdapter) {
        mName = pName;
        mUniversityAdapter = pUniversityAdapter;
    }

// Path: backend/src/main/java/com/github/istin/schedule/backend/adapter/grsu/GrsuAdapter.java
// public class GrsuAdapter implements IUniversityAdapter {
// 
//     public static final String BASE_URL_API = "http://api.grsu.by/1.x/app1/";
//     public static final String LECTURER_LIST_API = BASE_URL_API + "getTeachers?extended=false";
//     public static final String TEACHERS_SCHEDULE_LIST_API = BASE_URL_API + "getTeacherSchedule?teacherId=";
// 
//     @Override
//     public List<Lecturer> getLecturerList() throws Exception {
//         InputStream inputStream = null;
//         InputStreamReader inputStreamReader = null;
//         BufferedReader bufferedReader = null;
//         try {
//             inputStream = HttpUtils.getInputStream(LECTURER_LIST_API);
//             inputStreamReader = new InputStreamReader(inputStream, "UTF-8");
//             bufferedReader = new BufferedReader(inputStreamReader, 8192);
//             final LecturerResponse lecturerList = new Gson().fromJson(bufferedReader, LecturerResponse.class);
//             final List<LecturerModel> lecturers = lecturerList.getLecturers();
//             List<Lecturer> list = new ArrayList<>();
//             if (lecturers != null) {
//                 for (LecturerModel lecturerModel : lecturers) {
//                     final Lecturer lecturer = new Lecturer();
//                     lecturer.setId(lecturerModel.getId());
//                     lecturer.setName(lecturerModel.getFullName());
//                     list.add(lecturer);
//                 }
//             }
//             return list;
// 
//         } catch (IOException e) {
//             e.printStackTrace();
//         } finally {
//             HttpUtils.close(inputStream);
//             HttpUtils.close(inputStreamReader);
//             HttpUtils.close(bufferedReader);
//         }
// 
//         return new ArrayList<>();
//     }
// 
//     @Override
//     public List<Lesson> getLecturerScheduleList(String pLid) throws Exception {
//         InputStream inputStream = null;
//         InputStreamReader inputStreamReader = null;
//         BufferedReader bufferedReader = null;
//         try {
//             inputStream = HttpUtils.getInputStream(TEACHERS_SCHEDULE_LIST_API+pLid);
//             inputStreamReader = new InputStreamReader(inputStream, "UTF-8");
//             bufferedReader = new BufferedReader(inputStreamReader, 8192);
//             final LessonsResponse scheduleList = new Gson().fromJson(bufferedReader, LessonsResponse.class);
//             final List<LessonModel> lessons = scheduleList.getLessons();
//             List<Lesson> list = new ArrayList<>();
//             if (lessons != null) {
//                 for (LessonModel lessonModel : lessons) {
//                     list.add(lessonModel.doOptimize());
//                 }
//             }
//             return list;
// 
//         } catch (IOException e) {
//             e.printStackTrace();
//         } finally {
//             HttpUtils.close(inputStream);
//             HttpUtils.close(inputStreamReader);
//             HttpUtils.close(bufferedReader);
//         }
// 
//         return new ArrayList<>();
//     }
// }


// Path: backend/src/main/java/com/github/istin/schedule/backend/University.java
import com.github.istin.schedule.backend.adapter.grsu.GrsuAdapter;

package com.github.istin.schedule.backend;


/**
 * Created by uladzimir_klyshevich on 10/12/15.
 */
public enum University {

    GRSU("ГрГУ", new GrsuAdapter()),
    GR_MED_UNIVER("Гродненский Мед. университет", new GrsuAdapter());

    private String mName;

    private IUniversityAdapter mUniversityAdapter;

    University(String pName, IUniversityAdapter pUniversityAdapter) {
        mName = pName;
        mUniversityAdapter = pUniversityAdapter;
    }

    public String getName() {