io.quarkus.rest.client.reactive.runtime.ComputedParamContextImpl Maven / Gradle / Ivy
package io.quarkus.rest.client.reactive.runtime;
import static org.jboss.resteasy.reactive.client.impl.RestClientRequestContext.INVOKED_METHOD_PARAMETERS_PROP;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import jakarta.ws.rs.client.ClientRequestContext;
import io.quarkus.rest.client.reactive.ComputedParamContext;
@SuppressWarnings("unused")
public class ComputedParamContextImpl implements ComputedParamContext {
private final String name;
private final List parameters;
public ComputedParamContextImpl(String name, ClientRequestContext context) {
this.name = name;
this.parameters = createParameters(context);
}
@SuppressWarnings("unchecked")
private static List createParameters(ClientRequestContext context) {
Object property = context.getProperty(INVOKED_METHOD_PARAMETERS_PROP);
if (property == null) {
throw new IllegalStateException(
"property " + INVOKED_METHOD_PARAMETERS_PROP + " should have been part of the client context");
}
List