51
51
@ NoArgsConstructor (access = AccessLevel .PROTECTED )
52
52
@ AllArgsConstructor (access = AccessLevel .PACKAGE )
53
53
@ Getter
54
- @ EqualsAndHashCode (of = {"rel" , "href" , "hreflang" , "media" , "title" , "deprecation" })
54
+ @ EqualsAndHashCode (of = { "rel" , "href" , "hreflang" , "media" , "title" , "deprecation" })
55
55
public class Link implements Serializable {
56
56
57
57
private static final long serialVersionUID = -9037755944661782121L ;
@@ -65,14 +65,14 @@ public class Link implements Serializable {
65
65
public static final String REL_NEXT = "next" ;
66
66
public static final String REL_LAST = "last" ;
67
67
68
- @ XmlAttribute @ Wither private String rel ;
69
- @ XmlAttribute @ Wither private String href ;
70
- @ XmlAttribute @ Wither private String hreflang ;
71
- @ XmlAttribute @ Wither private String media ;
72
- @ XmlAttribute @ Wither private String title ;
73
- @ XmlAttribute @ Wither private String type ;
74
- @ XmlAttribute @ Wither private String deprecation ;
75
- @ XmlTransient @ JsonIgnore private UriTemplate template ;
68
+ private @ XmlAttribute @ Wither String rel ;
69
+ private @ XmlAttribute @ Wither String href ;
70
+ private @ XmlAttribute @ Wither String hreflang ;
71
+ private @ XmlAttribute @ Wither String media ;
72
+ private @ XmlAttribute @ Wither String title ;
73
+ private @ XmlAttribute @ Wither String type ;
74
+ private @ XmlAttribute @ Wither String deprecation ;
75
+ private @ XmlTransient @ JsonIgnore UriTemplate template ;
76
76
77
77
/**
78
78
* Creates a new link to the given URI with the self rel.
@@ -183,6 +183,7 @@ private UriTemplate getUriTemplate() {
183
183
*/
184
184
@ Override
185
185
public String toString () {
186
+
186
187
String linkString = String .format ("<%s>;rel=\" %s\" " , href , rel );
187
188
188
189
if (hreflang != null ) {
@@ -204,7 +205,7 @@ public String toString() {
204
205
if (deprecation != null ) {
205
206
linkString += ";deprecation=\" " + deprecation + "\" " ;
206
207
}
207
-
208
+
208
209
return linkString ;
209
210
}
210
211
@@ -276,7 +277,8 @@ private static Map<String, String> getAttributeMap(String source) {
276
277
}
277
278
278
279
Map <String , String > attributes = new HashMap <String , String >();
279
- Pattern keyAndValue = Pattern .compile ("(\\ w+)=\" (\\ p{Lower}[\\ p{Lower}\\ p{Digit}\\ .\\ -\\ s]*|" + URI_PATTERN + ")\" " );
280
+ Pattern keyAndValue = Pattern
281
+ .compile ("(\\ w+)=\" (\\ p{Lower}[\\ p{Lower}\\ p{Digit}\\ .\\ -\\ s]*|" + URI_PATTERN + ")\" " );
280
282
Matcher matcher = keyAndValue .matcher (source );
281
283
282
284
while (matcher .find ()) {
0 commit comments