| 1 | package edu.ucsb.cs156.courses.documents; | |
| 2 | ||
| 3 | import java.util.List; | |
| 4 | import java.util.stream.Collectors; | |
| 5 | import lombok.AllArgsConstructor; | |
| 6 | import lombok.Builder; | |
| 7 | import lombok.Data; | |
| 8 | import lombok.NoArgsConstructor; | |
| 9 | ||
| 10 | /** | |
| 11 |  * CourseInfo is an object that stores all of the information about a course from the UCSB Courses | |
| 12 |  * API except for the section info | |
| 13 |  */ | |
| 14 | @Data | |
| 15 | @Builder | |
| 16 | @NoArgsConstructor | |
| 17 | @AllArgsConstructor | |
| 18 | public class CourseInfo implements Cloneable { | |
| 19 |   private String quarter; | |
| 20 |   private String courseId; | |
| 21 |   private String title; | |
| 22 |   private String description; | |
| 23 |   private List<GeneralEducation> generalEducation; | |
| 24 | ||
| 25 |   public String ges() { | |
| 26 | 
1
1. ges : negated conditional → KILLED | 
    if (generalEducation == null) { | 
| 27 |       return ""; | |
| 28 |     } | |
| 29 | ||
| 30 |     List<String> gesAsListOfStrings = | |
| 31 |         generalEducation.stream().map(GeneralEducation::toString).collect(Collectors.toList()); | |
| 32 | 
1
1. ges : replaced return value with "" for edu/ucsb/cs156/courses/documents/CourseInfo::ges → KILLED | 
    return String.join(", ", gesAsListOfStrings); | 
| 33 |   } | |
| 34 | ||
| 35 |   public Object clone() throws CloneNotSupportedException { | |
| 36 |     CourseInfo newCourseInfo = (CourseInfo) super.clone(); | |
| 37 | 
1
1. clone : replaced return value with null for edu/ucsb/cs156/courses/documents/CourseInfo::clone → KILLED | 
    return newCourseInfo; | 
| 38 |   } | |
| 39 | } | |
Mutations | ||
| 26 | 
 
 1.1  | 
|
| 32 | 
 
 1.1  | 
|
| 37 | 
 
 1.1  |