Skip to content

Commit 05f687e

Browse files
committed
#567 - Polishing.
Field annotations inline. Formatting.
1 parent 891fd90 commit 05f687e

File tree

1 file changed

+13
-11
lines changed
  • src/main/java/org/springframework/hateoas

1 file changed

+13
-11
lines changed

src/main/java/org/springframework/hateoas/Link.java

+13-11
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
@NoArgsConstructor(access = AccessLevel.PROTECTED)
5252
@AllArgsConstructor(access = AccessLevel.PACKAGE)
5353
@Getter
54-
@EqualsAndHashCode(of = {"rel", "href", "hreflang", "media", "title", "deprecation"})
54+
@EqualsAndHashCode(of = { "rel", "href", "hreflang", "media", "title", "deprecation" })
5555
public class Link implements Serializable {
5656

5757
private static final long serialVersionUID = -9037755944661782121L;
@@ -65,14 +65,14 @@ public class Link implements Serializable {
6565
public static final String REL_NEXT = "next";
6666
public static final String REL_LAST = "last";
6767

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;
7676

7777
/**
7878
* Creates a new link to the given URI with the self rel.
@@ -183,6 +183,7 @@ private UriTemplate getUriTemplate() {
183183
*/
184184
@Override
185185
public String toString() {
186+
186187
String linkString = String.format("<%s>;rel=\"%s\"", href, rel);
187188

188189
if (hreflang != null) {
@@ -204,7 +205,7 @@ public String toString() {
204205
if (deprecation != null) {
205206
linkString += ";deprecation=\"" + deprecation + "\"";
206207
}
207-
208+
208209
return linkString;
209210
}
210211

@@ -276,7 +277,8 @@ private static Map<String, String> getAttributeMap(String source) {
276277
}
277278

278279
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 + ")\"");
280282
Matcher matcher = keyAndValue.matcher(source);
281283

282284
while (matcher.find()) {

0 commit comments

Comments
 (0)