@@ -20,13 +20,20 @@ public class Link {
2020 private String mimeType ;
2121
2222 @ NotNull
23- private Map <String , Object > properties ;
23+ private Map <String , String > properties ;
2424
2525 public Link () {}
2626
2727 public Link (Link source ) {
2828 this .href = source .href ;
2929 this .mimeType = source .mimeType ;
30+ this .properties = deepCopy (source .properties );
31+ }
32+
33+ @ SuppressWarnings ("unchecked" )
34+ private static Map <String , String > deepCopy (Map <String , String > properties ) {
35+ String intermediate = JSON .serialize (properties );
36+ return JSON .deserialize (intermediate , properties .getClass ());
3037 }
3138
3239 public String getHref () {
@@ -37,7 +44,7 @@ public String getMimeType() {
3744 return mimeType ;
3845 }
3946
40- public Map <String , Object > getProperties () {
47+ public Map <String , String > getProperties () {
4148 return properties ;
4249 }
4350
@@ -49,7 +56,7 @@ public void setMimeType(String mimeType) {
4956 this .mimeType = mimeType ;
5057 }
5158
52- public void setProperties (Map <String , Object > properties ) {
59+ public void setProperties (Map <String , String > properties ) {
5360 this .properties = properties ;
5461 }
5562
@@ -70,7 +77,9 @@ public boolean equals(Object obj) {
7077 return false ;
7178 }
7279 Link other = (Link ) obj ;
73- return Objects .equals (href , other .href ) && Objects .equals (mimeType , other .mimeType ) && Objects .equals (properties , other .properties );
80+ return Objects .equals (href , other .href )
81+ && Objects .equals (mimeType , other .mimeType )
82+ && Objects .equals (properties , other .properties );
7483 }
7584
7685 @ Override
0 commit comments