Skip to content

Commit

Permalink
Change string conversion method
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony (Juntao) Hu committed Dec 5, 2021
1 parent 65652d3 commit 6ce3bb9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/src/main/java/com/amigo/user/Profile.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.ArrayList;
import java.util.HashSet;
import java.util.stream.Collectors;

import javax.persistence.Entity;
import com.amigo.course.Course;
Expand Down Expand Up @@ -99,13 +100,13 @@ public HashSet<Course> getCourses() {
public ArrayList<String> getCoursesList() {
ArrayList<String> coursesStringList = new ArrayList<>();
for (Course course : courses) {
coursesStringList.add(course.toString());
coursesStringList.add(course.getCourseCode());
}
return coursesStringList;
}

public String getCoursesAsString() {
return getCoursesList().toString();
return getCoursesList().stream().collect(Collectors.joining(" "));
}

/**
Expand Down

0 comments on commit 6ce3bb9

Please sign in to comment.