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

com.yahoo.vespa.jaxrs.client.LocalPassThroughJaxRsStrategy Maven / Gradle / Ivy

There is a newer version: 7.579.27
Show newest version
// 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