org.zodiac.feign.http2client.uitl.Http2ClientUtil Maven / Gradle / Ivy
The newest version!
package org.zodiac.feign.http2client.uitl;
import java.net.http.HttpClient;
import org.zodiac.sdk.toolkit.http.PlatformHttpVersion;
public abstract class Http2ClientUtil {
private Http2ClientUtil() {
super();
}
public static HttpClient.Version toHttp2ClientVersion(PlatformHttpVersion httpVersion) {
switch (httpVersion) {
case HTTP_1_1:
return HttpClient.Version.HTTP_1_1;
case HTTP_2:
return HttpClient.Version.HTTP_2;
default:
throw new IllegalArgumentException(String.format("Unsupported HTTP version %s for Http2 Client.", httpVersion));
}
}
}