mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2025-09-08 17:59:43 +02:00
Profile: Use Optional for description
This commit is contained in:
parent
aa88904711
commit
c479cc8ef3
3 changed files with 171 additions and 7 deletions
|
@ -38,8 +38,10 @@ public class ListProfilesExternal implements ListProfiles {
|
|||
private static List<Profile> toProfiles(String output) {
|
||||
List<Profile> profiles = new ArrayList<>();
|
||||
for (String line : output.split("\n")) {
|
||||
String[] split = line.split(": ");
|
||||
profiles.add(new Profile(split[0], split[1]));
|
||||
if (line.trim().isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
profiles.add(Profile.parse(line));
|
||||
}
|
||||
return profiles;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue