Package org.gedcomx.links
Class Link
java.lang.Object
org.gedcomx.links.Link
- All Implemented Interfaces:
HasJsonKey
A hypermedia link, used to drive the state of a hypermedia-enabled genealogical data application.
- Author:
- Ryan Heaton
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe list of link rels that support multi-valued links. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBuild out this link with an accept.Build out this link with an 'allow'.Build out this link with a count.Metadata about the acceptable media type(s) that can be used to update (i.e.getAllow()Metadata about the allowable methods that can be used to transition to the resource being linked.getCount()The number of elements in the page, if this link refers to a page of resources.getHref()The target IRI of the link.The language of the resource being linked to.Format this link as a Link header per RFC 5988.The json key that is used define this link in a map.The index of the offset of the page, if this link refers to a page of resources.getRel()The link relationship.The total number of results in the page to which this links, if this link refers to a page of resources.A URI template per RFC 6570, used to link to a range of URIs, such as for the purpose of linking to a query.getTitle()Human-readable information about the link.getType()Metadata about the available media type(s) of the resource being linked to.Build out this link with an href.Build out this link with an href lang.booleanBuild out this link with an offset.Build out this link with a rel.Build out this link with total results.voidMetadata about the media type(s) that can be used to update (i.e.voidMetadata about the allowable methods that can be used to transition to the resource being linked.voidThe number of elements in the page, if this link refers to a page of resources.voidThe link URI.voidsetHreflang(String hreflang) The language of the resource being linked to.voidsetJsonKey(String jsonKey) The json key that is used define this link in a map.voidThe index of the offset of the page, if this link refers to a page of resources.voidThe link relationship.voidsetResults(Integer results) The total number of results in the page to which this links, if this link refers to a page of resources.voidsetTemplate(String template) A URI template per RFC 6570, used to link to a range of URIs, such as for the purpose of linking to a query.voidHuman-readable information about the link.voidMetadata about the available media type(s) of the resource being linked to.Build out this link with a template.Build out this link with a title.toString()Build out this link with a type.
-
Field Details
-
NON_UNIQUE_RELS
The list of link rels that support multi-valued links. Be careful about editing this because it might break backwards-compatibility with JSON clients.
-
-
Constructor Details
-
Link
public Link() -
Link
-
Link
-
-
Method Details
-
isHasUniqueKey
public boolean isHasUniqueKey()- Specified by:
isHasUniqueKeyin interfaceHasJsonKey
-
getRel
The link relationship.- Returns:
- The link relationship.
-
setRel
The link relationship.- Parameters:
rel- The link relationship.
-
rel
Build out this link with a rel.- Parameters:
rel- The rel.- Returns:
- this.
-
getJsonKey
The json key that is used define this link in a map.- Specified by:
getJsonKeyin interfaceHasJsonKey- Returns:
- The json key that is used define this link in a map.
-
setJsonKey
The json key that is used define this link in a map.- Specified by:
setJsonKeyin interfaceHasJsonKey- Parameters:
jsonKey- The json key that is used define this link in a map.
-
getHref
The target IRI of the link.- Returns:
- The target IRI of the link.
-
setHref
The link URI.- Parameters:
href- The link URI.
-
href
Build out this link with an href.- Parameters:
href- The href.- Returns:
- this.
-
getTemplate
A URI template per RFC 6570, used to link to a range of URIs, such as for the purpose of linking to a query. A link specifying a template can be formally referred to as a "Templated Link (LT)" per Amundsen, M. (2011). Hypermedia APIs with HTML5 and Node. O'Reilly.- Returns:
- A URI template per RFC 6570, used to link to a range of URIs, such as for the purpose of linking to a query.
-
setTemplate
A URI template per RFC 6570, used to link to a range of URIs, such as for the purpose of linking to a query. A link specifying a template can be formally referred to as a "Templated Link (LT)" per Amundsen, M. (2011). Hypermedia APIs with HTML5 and Node. O'Reilly.- Parameters:
template- A URI template per RFC 6570, used to link to a range of URIs, such as for the purpose of linking to a query.
-
template
Build out this link with a template.- Parameters:
template- The template- Returns:
- this.
-
getType
Metadata about the available media type(s) of the resource being linked to. The value of the "type" attribute is as defined by the HTTP specification, RFC 2616, Section 3.7. Note that this attribute can be considered an "Update Control (CU)" per Amundsen, M. (2011). Hypermedia APIs with HTML5 and Node. O'Reilly.- Returns:
- Metadata about the available media type(s) of the resource being linked to.
-
setType
Metadata about the available media type(s) of the resource being linked to. The value of the "type" attribute is as defined by the HTTP specification, RFC 2616, Section 3.7. Note that this attribute can be considered an "Read Control (CR)" per Amundsen, M. (2011). Hypermedia APIs with HTML5 and Node. O'Reilly.- Parameters:
type- Metadata about the available media type(s) of the resource being linked to.
-
type
Build out this link with a type.- Parameters:
type- The type.- Returns:
- this.
-
getAccept
Metadata about the acceptable media type(s) that can be used to update (i.e. change the state of) the resource being linked to. The value of the "accept" attribute is as defined by the HTTP specification, RFC 2616, Section 3.7. Note that this attribute can be considered an "Read Control (CR)" per Amundsen, M. (2011). Hypermedia APIs with HTML5 and Node. O'Reilly.- Returns:
- Metadata about the available media type(s) of the resource being linked to.
-
setAccept
Metadata about the media type(s) that can be used to update (i.e. change the state of) the resource being linked to. The value of the "accept" attribute is as defined by the HTTP specification, RFC 2616, Section 3.7. Note that this attribute can be considered an "Update Control (CU)" per Amundsen, M. (2011). Hypermedia APIs with HTML5 and Node. O'Reilly.- Parameters:
accept- Metadata about the available media type(s) of the resource being linked to.
-
accept
Build out this link with an accept.- Parameters:
accept- The accept.- Returns:
- this.
-
getAllow
Metadata about the allowable methods that can be used to transition to the resource being linked. The value of the "allow" attribute is as defined by the HTTP specification, RFC 2616, Section 14.7. Note that this attribute can be considered an "Method Control (CM)" per Amundsen, M. (2011). Hypermedia APIs with HTML5 and Node. O'Reilly.- Returns:
- Metadata about the available media type(s) of the resource being linked to.
-
setAllow
Metadata about the allowable methods that can be used to transition to the resource being linked. The value of the "allow" attribute is as defined by the HTTP specification, RFC 2616, Section 14.7. Note that this attribute can be considered an "Method Control (CM)" per Amundsen, M. (2011). Hypermedia APIs with HTML5 and Node. O'Reilly.- Parameters:
allow- Metadata about the available media type(s) of the resource being linked to.
-
allow
Build out this link with an 'allow'.- Parameters:
allow- The allow.- Returns:
- this.
-
getHreflang
The language of the resource being linked to. Note that this attribute can be considered an "Update Control (CU)" per Amundsen, M. (2011). Hypermedia APIs with HTML5 and Node. O'Reilly.- Returns:
- The language of the resource being linked to.
-
setHreflang
The language of the resource being linked to. Note that this attribute can be considered an "Update Control (CU)" per Amundsen, M. (2011). Hypermedia APIs with HTML5 and Node. O'Reilly.- Parameters:
hreflang- The language of the resource being linked to.
-
hreflang
Build out this link with an href lang.- Parameters:
hreflang- The hreflang.- Returns:
- this.
-
getTitle
Human-readable information about the link.- Returns:
- Human-readable information about the link.
-
setTitle
Human-readable information about the link.- Parameters:
title- Human-readable information about the link.
-
title
Build out this link with a title.- Parameters:
title- The title.- Returns:
- this.
-
getCount
The number of elements in the page, if this link refers to a page of resources.- Returns:
- The number of elements in the page, if this link refers to a page of resources.
-
setCount
The number of elements in the page, if this link refers to a page of resources.- Parameters:
count- The number of elements in the page, if this link refers to a page of resources.
-
count
Build out this link with a count.- Parameters:
count- The count.- Returns:
- this.
-
getOffset
The index of the offset of the page, if this link refers to a page of resources.- Returns:
- The index of the offset of the page, if this link refers to a page of resources.
-
setOffset
The index of the offset of the page, if this link refers to a page of resources.- Parameters:
offset- The index of the offset of the page, if this link refers to a page of resources.
-
offset
Build out this link with an offset.- Parameters:
offset- The offset.- Returns:
- this.
-
getResults
The total number of results in the page to which this links, if this link refers to a page of resources.- Returns:
- The total number of results in the page to which this links, if this link refers to a page of resources.
-
setResults
The total number of results in the page to which this links, if this link refers to a page of resources.- Parameters:
results- The total number of results in the page to which this links, if this link refers to a page of resources.
-
results
Build out this link with total results.- Parameters:
results- The total results count.- Returns:
- this.
-
getHttpHeaderValue
Format this link as a Link header per RFC 5988.- Returns:
- The value of this link formatted per RFC 5988.
-
toString
-