Skip to content

Commit 6ac8bd6

Browse files
author
bengtson.lennart
committed
Minor cleaning up
1 parent 3ffb0db commit 6ac8bd6

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

src/main/i5/las2peer/services/privacyControl/Consent/ConsentLevel.java

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* ConsentLevel
1515
*
1616
* Class that defines object for a certain level of consent.
17-
* Includes information about the functions (e.g. from a LMS) that are included.
17+
* Includes information about the services and actions that are included.
1818
*
1919
*/
2020
public class ConsentLevel {
@@ -32,7 +32,6 @@ public ConsentLevel(String name, int level, List<String> functions, List<String>
3232
this.functions = functions;
3333
this.services = services;
3434
this.timestamp = timestamp;
35-
3635
formattedOutput = formatStringOutput();
3736
}
3837

@@ -69,32 +68,36 @@ public void setServices(List<String> services) {
6968
}
7069

7170
private String formatStringOutput() {
72-
String output = "";
73-
output += ("[" + getLevel() + "] " + getName() + "\n");
74-
output += "Services: ";
71+
StringBuilder stringBuilder = new StringBuilder();
72+
stringBuilder.append("[");
73+
stringBuilder.append(getLevel());
74+
stringBuilder.append("] ");
75+
stringBuilder.append(getName());
76+
stringBuilder.append("\n");
77+
stringBuilder.append("Services: ");
7578

7679
Iterator<String> iterator = getServices().iterator();
7780
while (iterator.hasNext()) {
7881
String service = iterator.next();
79-
output += service;
82+
stringBuilder.append(service);
8083
if (iterator.hasNext()) {
81-
output += ", ";
84+
stringBuilder.append(", ");
8285
}
8386
}
8487

85-
output += "\n";
86-
output += "Aktionen: ";
88+
stringBuilder.append("\n");
89+
stringBuilder.append("Aktionen: ");
8790

8891
iterator = getFunctions().iterator();
8992
while (iterator.hasNext()) {
9093
String function = iterator.next();
91-
output += function;
94+
stringBuilder.append(function);
9295
if (iterator.hasNext()) {
93-
output += ", ";
96+
stringBuilder.append(", ");
9497
}
9598
}
96-
output += "\n";
97-
return output;
99+
stringBuilder.append("\n");
100+
return stringBuilder.toString();
98101
}
99102

100103
@Override

src/main/i5/las2peer/services/privacyControl/TransactionLogging/LogEntry.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ public void setDataHash(String dataHash) {
5858

5959
@Override
6060
public String toString() {
61-
// TODO Export as JSON (file)?!
6261
return getTimestampFormatted() + ": Source: " + getSource() + ", Type: " + getOperation() + "\n" + "Hash: " + getDataHash() + "\n";
6362
}
6463

0 commit comments

Comments
 (0)