1919import io .netty .handler .codec .http .HttpHeaders ;
2020import org .asynchttpclient .Realm ;
2121import org .asynchttpclient .Request ;
22+ import org .jetbrains .annotations .Nullable ;
2223
2324import java .util .ArrayList ;
2425import java .util .Collections ;
@@ -36,12 +37,13 @@ public class ProxyServer {
3637 private final String host ;
3738 private final int port ;
3839 private final int securedPort ;
39- private final Realm realm ;
40+ private final @ Nullable Realm realm ;
4041 private final List <String > nonProxyHosts ;
4142 private final ProxyType proxyType ;
42- private final Function <Request , HttpHeaders > customHeaders ;
43+ private final @ Nullable Function <Request , HttpHeaders > customHeaders ;
4344
44- public ProxyServer (String host , int port , int securedPort , Realm realm , List <String > nonProxyHosts , ProxyType proxyType , Function <Request , HttpHeaders > customHeaders ) {
45+ public ProxyServer (String host , int port , int securedPort , @ Nullable Realm realm , List <String > nonProxyHosts , ProxyType proxyType ,
46+ @ Nullable Function <Request , HttpHeaders > customHeaders ) {
4547 this .host = host ;
4648 this .port = port ;
4749 this .securedPort = securedPort ;
@@ -71,15 +73,15 @@ public List<String> getNonProxyHosts() {
7173 return nonProxyHosts ;
7274 }
7375
74- public Realm getRealm () {
76+ public @ Nullable Realm getRealm () {
7577 return realm ;
7678 }
7779
7880 public ProxyType getProxyType () {
7981 return proxyType ;
8082 }
8183
82- public Function <Request , HttpHeaders > getCustomHeaders () {
84+ public @ Nullable Function <Request , HttpHeaders > getCustomHeaders () {
8385 return customHeaders ;
8486 }
8587
@@ -129,10 +131,10 @@ public static class Builder {
129131 private final String host ;
130132 private final int port ;
131133 private int securedPort ;
132- private Realm realm ;
133- private List <String > nonProxyHosts ;
134- private ProxyType proxyType ;
135- private Function <Request , HttpHeaders > customHeaders ;
134+ private @ Nullable Realm realm ;
135+ private @ Nullable List <String > nonProxyHosts ;
136+ private @ Nullable ProxyType proxyType ;
137+ private @ Nullable Function <Request , HttpHeaders > customHeaders ;
136138
137139 public Builder (String host , int port ) {
138140 this .host = host ;
0 commit comments