Search in sources :

Example 1 with RestIdMatcher

use of com.github.dreamhead.moco.RestIdMatcher in project moco by dreamhead.

the class SubResourceSetting method getMatched.

@Override
public Optional<ResponseHandler> getMatched(final RestIdMatcher resourceName, final HttpRequest httpRequest) {
    for (RestSetting setting : settings) {
        RestIdMatcher idMatcher = RestIdMatchers.match(join(resourceName.resourceUri(), this.id.resourceUri(), this.name));
        Optional<ResponseHandler> responseHandler = setting.getMatched(idMatcher, httpRequest);
        if (responseHandler.isPresent()) {
            return responseHandler;
        }
    }
    return Optional.absent();
}
Also used : RestIdMatcher(com.github.dreamhead.moco.RestIdMatcher) RestSetting(com.github.dreamhead.moco.RestSetting) ResponseHandler(com.github.dreamhead.moco.ResponseHandler)

Aggregations

ResponseHandler (com.github.dreamhead.moco.ResponseHandler)1 RestIdMatcher (com.github.dreamhead.moco.RestIdMatcher)1 RestSetting (com.github.dreamhead.moco.RestSetting)1