io.crnk.rs.internal.legacy.RequestContextParameterProviderRegistry Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of crnk-rs Show documentation
Show all versions of crnk-rs Show documentation
JSON API framework for Java
package io.crnk.rs.internal.legacy;
import io.crnk.core.utils.Optional;
import io.crnk.rs.internal.legacy.provider.Parameter;
import io.crnk.rs.internal.legacy.provider.RequestContextParameterProvider;
import java.util.Collection;
import java.util.Set;
public class RequestContextParameterProviderRegistry {
private Set parameterProviders;
public RequestContextParameterProviderRegistry(Set parameterProviders) {
this.parameterProviders = parameterProviders;
}
public Optional findProviderFor(Parameter parameter) {
for (RequestContextParameterProvider parameterProvider : parameterProviders) {
if (parameterProvider.provides(parameter)) {
return Optional.of(parameterProvider);
}
}
return Optional.empty();
}
public Collection getParameterProviders() {
return parameterProviders;
}
public void setParameterProviders(Set parameterProviders) {
this.parameterProviders = parameterProviders;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy