Package org.apache.juneau.bean.jsonapi
Class JsonApiLink
java.lang.Object
org.apache.juneau.bean.jsonapi.JsonApiLink
Represents a JSON:API Link Object as defined by
JSON:API v1.1 § Links.
Per the spec, each links entry may be either a JSON string URL or a JSON object with these members:
href (required URI), rel, describedby, title, type (media-type hint),
hreflang (language tag), and meta. The single-vs-object union is handled by
JsonApiLinkOrStringSwap, applied via field-level @BeanProp("links") @Swap(...) on every type
carrying a links map.
See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.JsonApiLink(String href) Convenience constructor with the requiredhreffield. -
Method Summary
Modifier and TypeMethodDescriptionBean property getter:describedby .getHref()Bean property getter:href .Bean property getter:hreflang .getMeta()Bean property getter:meta .getRel()Bean property getter:rel .getTitle()Bean property getter:title .getType()Bean property getter:type .Convenience method to add a single meta entry.setDescribedby(String value) Bean property setter:describedby .Bean property setter:href .setHreflang(String value) Bean property setter:hreflang .Bean property setter:meta .Bean property setter:rel .Bean property setter:title .Bean property setter:type .toString()
-
Constructor Details
-
JsonApiLink
public JsonApiLink()Default constructor. -
JsonApiLink
Convenience constructor with the requiredhreffield.- Parameters:
href- The link target URI. Can benull to leave the property unset.
-
-
Method Details
-
getHref
Bean property getter:href .- Returns:
- The value of the
href property, ornull if it is not set.
-
setHref
Bean property setter:href .- Parameters:
value- The new value for this property. Can benull to unset the property.- Returns:
- This object.
-
getRel
Bean property getter:rel .- Returns:
- The value of the
rel property, ornull if it is not set.
-
setRel
Bean property setter:rel .- Parameters:
value- The new value for this property. Can benull to unset the property.- Returns:
- This object.
-
getDescribedby
Bean property getter:describedby .- Returns:
- The value of the
describedby property, ornull if it is not set.
-
setDescribedby
Bean property setter:describedby .- Parameters:
value- The new value for this property. Can benull to unset the property.- Returns:
- This object.
-
getTitle
Bean property getter:title .- Returns:
- The value of the
title property, ornull if it is not set.
-
setTitle
Bean property setter:title .- Parameters:
value- The new value for this property. Can benull to unset the property.- Returns:
- This object.
-
getType
Bean property getter:type .Media-type hint for the target resource.
- Returns:
- The value of the
type property, ornull if it is not set.
-
setType
Bean property setter:type .- Parameters:
value- The new value for this property. Can benull to unset the property.- Returns:
- This object.
-
getHreflang
Bean property getter:hreflang .- Returns:
- The value of the
hreflang property, ornull if it is not set.
-
setHreflang
Bean property setter:hreflang .- Parameters:
value- The new value for this property. Can benull to unset the property.- Returns:
- This object.
-
getMeta
Bean property getter:meta .- Returns:
- The value of the
meta property, ornull if it is not set.
-
setMeta
Bean property setter:meta .- Parameters:
value- The new value for this property. Can benull to unset the property.- Returns:
- This object.
-
putMeta
Convenience method to add a single meta entry.- Parameters:
name- The meta key. Can benull (LinkedHashMaptolerates anull key).value- The meta value. Can benull (stored asnull ).- Returns:
- This object.
-
toString
-