Package io.jenkins.blueocean.rest.hal
Class Links
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<String,
Link>
Implementation of
JSON Hypertext application language (HAL).
- Only _links element is implemented
- Only required href element is supported
- TODO: decide on whether application/hal+json or just use application/json
Resource
implementation can add their resource specific path by calling
add(String, Link)
Example:
{
"_links":{
"self":{"href":"http://.../pipelines/1/runs/23"},
"test":{"href":"http://.../pipelines/1/runs/23/test"}
}
}
- Author:
- Vivek Pandey
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
-
Method Summary
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Constructor Details
-
Links
-
-
Method Details
-
add
-
self
-
add
Add a new link with key 'ref' and href being self.href+reflinks.add("testResult"); { "_links":[ { "self":{"href":"/organizations/jenkins/pipelines/p1/runs/2/"}, "testResult":{"href":"/organizations/jenkins/pipelines/p1/runs/2/testResult"}, } ] }
- Parameters:
ref
- relative path to be added as newLink
relative to 'self''s href- Returns:
- this Links instance
-
ensureTrailingSlash
-