Package com.github.jasminb.jsonapi
Class Links
- java.lang.Object
-
- com.github.jasminb.jsonapi.Links
-
- All Implemented Interfaces:
Serializable
public class Links extends Object implements Serializable
JSON API spec links object.- Author:
- jbegic
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLink(String linkName, Link link)Adds a named link.LinkgetFirst()Convenience method for returning thefirstlink.LinkgetLast()Convenience method for returning thelastlink.LinkgetLink(String linkName)Convenience method for returning named link.Map<String,Link>getLinks()Gets all registered links.LinkgetNext()Convenience method for returning thenextlink.LinkgetPrevious()Convenience method for returning theprevlink.LinkgetRelated()Convenience method for returning therelatedlink.LinkgetSelf()Convenience method for returning theselflink.
-
-
-
Method Detail
-
getLink
public Link getLink(String linkName)
Convenience method for returning named link.- Parameters:
linkName- name of the link to return- Returns:
- the link object, or
nullif the named link does not exist
-
getPrevious
public Link getPrevious()
Convenience method for returning theprevlink.- Returns:
- the link, or
nullif the named link does not exist
-
getFirst
public Link getFirst()
Convenience method for returning thefirstlink.- Returns:
- the link, or
nullif the named link does not exist
-
getNext
public Link getNext()
Convenience method for returning thenextlink.- Returns:
- the link, or
nullif the named link does not exist
-
getLast
public Link getLast()
Convenience method for returning thelastlink.- Returns:
- the link, or
nullif the named link does not exist
-
getSelf
public Link getSelf()
Convenience method for returning theselflink.- Returns:
- the link, or
nullif the named link does not exist
-
getRelated
public Link getRelated()
Convenience method for returning therelatedlink.- Returns:
- the link, or
nullif the named link does not exist
-
-