uk.co.autotrader.traverson.link.BasicLinkDiscoverer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of traverson4j-core Show documentation
Show all versions of traverson4j-core Show documentation
The kernel of traverson4j. This provides the main API for a client to traverse a Hypermedia REST service
The newest version!
package uk.co.autotrader.traverson.link;
import com.alibaba.fastjson2.JSONObject;
import uk.co.autotrader.traverson.exception.UnknownRelException;
public class BasicLinkDiscoverer implements LinkDiscoverer {
@Override
public String findHref(JSONObject responseEntity, String rel) {
if (responseEntity.containsKey(rel)) {
return responseEntity.getString(rel);
}
throw new UnknownRelException(rel);
}
}