com.yahoo.vespa.jaxrs.client.LocalPassThroughJaxRsStrategy Maven / Gradle / Ivy
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.jaxrs.client;
import java.io.IOException;
import java.util.function.Function;
/**
* A {@link JaxRsStrategy} that does not use the network, only forwards calls to a local object.
*
* @author bakksjo
*/
public class LocalPassThroughJaxRsStrategy implements JaxRsStrategy {
private final T api;
public LocalPassThroughJaxRsStrategy(final T api) {
this.api = api;
}
@Override
public R apply(final Function function) throws IOException {
return function.apply(api);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy