All Downloads are FREE. Search and download functionalities are using the official Maven repository.

uk.co.autotrader.traverson.link.BasicLinkDiscoverer Maven / Gradle / Ivy

Go to download

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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy