com.linkedin.restli.client.config.RequestConfigProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of parseq-restli-client Show documentation
Show all versions of parseq-restli-client Show documentation
Uploads all artifacts belonging to configuration ':parseq-restli-client:archives'
package com.linkedin.restli.client.config;
import java.util.function.Function;
import com.linkedin.restli.client.InboundRequestContextFinder;
import com.linkedin.restli.client.ParSeqRestliClientConfig;
import com.linkedin.restli.client.Request;
@FunctionalInterface
public interface RequestConfigProvider extends Function, RequestConfig> {
/**
* @param config configuration
* @param inboundRequestContextFinder request config finder
* @throws RuntimeException throws exception if config provider could not be built
* @return instance of RequestConfigProvider
*/
public static RequestConfigProvider build(ParSeqRestliClientConfig config, InboundRequestContextFinder inboundRequestContextFinder) {
try {
RequestConfigProviderBuilder builder = new RequestConfigProviderBuilder();
builder.setInboundRequestFinder(inboundRequestContextFinder)
.addConfig(getDefaultConfig());
if (config != null) {
builder.addConfig(config);
}
return builder.build();
} catch (RequestConfigKeyParsingException e) {
throw new RuntimeException(e);
}
}
public static ParSeqRestliClientConfig getDefaultConfig() {
return RequestConfigProviderImpl.DEFAULT_CONFIG;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy