14
14
* ConsentLevel
15
15
*
16
16
* 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.
18
18
*
19
19
*/
20
20
public class ConsentLevel {
@@ -32,7 +32,6 @@ public ConsentLevel(String name, int level, List<String> functions, List<String>
32
32
this .functions = functions ;
33
33
this .services = services ;
34
34
this .timestamp = timestamp ;
35
-
36
35
formattedOutput = formatStringOutput ();
37
36
}
38
37
@@ -69,32 +68,36 @@ public void setServices(List<String> services) {
69
68
}
70
69
71
70
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: " );
75
78
76
79
Iterator <String > iterator = getServices ().iterator ();
77
80
while (iterator .hasNext ()) {
78
81
String service = iterator .next ();
79
- output += service ;
82
+ stringBuilder . append ( service ) ;
80
83
if (iterator .hasNext ()) {
81
- output += ", " ;
84
+ stringBuilder . append ( ", " ) ;
82
85
}
83
86
}
84
87
85
- output += "\n " ;
86
- output += "Aktionen: " ;
88
+ stringBuilder . append ( "\n " ) ;
89
+ stringBuilder . append ( "Aktionen: " ) ;
87
90
88
91
iterator = getFunctions ().iterator ();
89
92
while (iterator .hasNext ()) {
90
93
String function = iterator .next ();
91
- output += function ;
94
+ stringBuilder . append ( function ) ;
92
95
if (iterator .hasNext ()) {
93
- output += ", " ;
96
+ stringBuilder . append ( ", " ) ;
94
97
}
95
98
}
96
- output += "\n " ;
97
- return output ;
99
+ stringBuilder . append ( "\n " ) ;
100
+ return stringBuilder . toString () ;
98
101
}
99
102
100
103
@ Override
0 commit comments