@@ -21,8 +21,9 @@ public EvaluationContext() {
2121
2222 // TODO Not sure if I should have sneakythrows or checked exceptions here..
2323 @ SneakyThrows
24- public <T > void addStructureAttribute (String key , T value ) {
24+ public <T > EvaluationContext addStructureAttribute (String key , T value ) {
2525 attributes .put (key , new Pair <>(FlagValueType .OBJECT , value ));
26+ return this ;
2627 }
2728
2829 @ SneakyThrows
@@ -34,8 +35,9 @@ public Map<String, String> getStructureAttributes() {
3435 return getAttributesByType (FlagValueType .OBJECT );
3536 }
3637
37- public void addStringAttribute (String key , String value ) {
38+ public EvaluationContext addStringAttribute (String key , String value ) {
3839 attributes .put (key , new Pair <>(FlagValueType .STRING , value ));
40+ return this ;
3941 }
4042
4143 public String getStringAttribute (String key ) {
@@ -68,8 +70,9 @@ public Map<String, String> getStringAttributes() {
6870 return getAttributesByType (FlagValueType .STRING );
6971 }
7072
71- public void addIntegerAttribute (String key , Integer value ) {
73+ public EvaluationContext addIntegerAttribute (String key , Integer value ) {
7274 attributes .put (key , new Pair <>(FlagValueType .INTEGER , value ));
75+ return this ;
7376 }
7477
7578 public Integer getIntegerAttribute (String key ) {
@@ -84,16 +87,18 @@ public Boolean getBooleanAttribute(String key) {
8487 return getAttributeByType (key , FlagValueType .BOOLEAN );
8588 }
8689
87- public void addBooleanAttribute (String key , Boolean b ) {
90+ public EvaluationContext addBooleanAttribute (String key , Boolean b ) {
8891 attributes .put (key , new Pair <>(FlagValueType .BOOLEAN , b ));
92+ return this ;
8993 }
9094
9195 public Map <String , Boolean > getBooleanAttributes () {
9296 return getAttributesByType (FlagValueType .BOOLEAN );
9397 }
9498
95- public void addDatetimeAttribute (String key , ZonedDateTime value ) {
99+ public EvaluationContext addDatetimeAttribute (String key , ZonedDateTime value ) {
96100 attributes .put (key , new Pair <>(FlagValueType .STRING , value .format (DateTimeFormatter .ISO_ZONED_DATE_TIME )));
101+ return this ;
97102 }
98103
99104 public ZonedDateTime getDatetimeAttribute (String key ) {
0 commit comments