#653 - Polishing.
Expose nullability in Identifiable, ResourceSupport and Links via Optional.
This commit is contained in:
@@ -18,6 +18,7 @@ package org.springframework.hateoas;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Optional;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
@@ -105,7 +106,7 @@ public class PagedResources<T> extends Resources<T> {
|
||||
* @return
|
||||
*/
|
||||
@JsonIgnore
|
||||
public Link getNextLink() {
|
||||
public Optional<Link> getNextLink() {
|
||||
return getLink(Link.REL_NEXT);
|
||||
}
|
||||
|
||||
@@ -115,7 +116,7 @@ public class PagedResources<T> extends Resources<T> {
|
||||
* @return
|
||||
*/
|
||||
@JsonIgnore
|
||||
public Link getPreviousLink() {
|
||||
public Optional<Link> getPreviousLink() {
|
||||
return getLink(Link.REL_PREVIOUS);
|
||||
}
|
||||
|
||||
@@ -251,8 +252,8 @@ public class PagedResources<T> extends Resources<T> {
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("Metadata { number: %d, total pages: %d, total elements: %d, size: %d }", number,
|
||||
totalPages, totalElements, size);
|
||||
return String.format("Metadata { number: %d, total pages: %d, total elements: %d, size: %d }", number, totalPages,
|
||||
totalElements, size);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user