Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions playwright/src/main/java/com/microsoft/playwright/APIRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class NewContextOptions {
* {@code http://localhost:3000/bar.html}</li>
* </ul>
*/
public NewContextOptions setBaseURL(String baseURL) {
public NewContextOptions setBaseURL(@Nullable String baseURL) {
this.baseURL = baseURL;
return this;
}
Expand All @@ -149,21 +149,21 @@ public NewContextOptions setBaseURL(String baseURL) {
* <p> <strong>NOTE:</strong> When using WebKit on macOS, accessing {@code localhost} will not pick up client certificates. You can make it work by
* replacing {@code localhost} with {@code local.playwright}.
*/
public NewContextOptions setClientCertificates(List<ClientCertificate> clientCertificates) {
public NewContextOptions setClientCertificates(@Nullable List<ClientCertificate> clientCertificates) {
this.clientCertificates = clientCertificates;
return this;
}
/**
* An object containing additional HTTP headers to be sent with every request. Defaults to none.
*/
public NewContextOptions setExtraHTTPHeaders(Map<String, String> extraHTTPHeaders) {
public NewContextOptions setExtraHTTPHeaders(@Nullable Map<String, String> extraHTTPHeaders) {
this.extraHTTPHeaders = extraHTTPHeaders;
return this;
}
/**
* Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status codes.
*/
public NewContextOptions setFailOnStatusCode(boolean failOnStatusCode) {
public NewContextOptions setFailOnStatusCode(@Nullable Boolean failOnStatusCode) {
this.failOnStatusCode = failOnStatusCode;
return this;
}
Expand All @@ -184,7 +184,7 @@ public NewContextOptions setHttpCredentials(String username, String password) {
* <p> Pass an array to use different credentials for different origins. The first entry that matches the request origin is
* used, and entries with no origin match any request.
*/
public NewContextOptions setHttpCredentials(HttpCredentials httpCredentials) {
public NewContextOptions setHttpCredentials(@Nullable HttpCredentials httpCredentials) {
this.httpCredentials = httpCredentials;
return this;
}
Expand All @@ -195,14 +195,14 @@ public NewContextOptions setHttpCredentials(HttpCredentials httpCredentials) {
* <p> Pass an array to use different credentials for different origins. The first entry that matches the request origin is
* used, and entries with no origin match any request.
*/
public NewContextOptions setHttpCredentials(List<HttpCredentials> httpCredentials) {
public NewContextOptions setHttpCredentials(@Nullable List<HttpCredentials> httpCredentials) {
this.httpCredentials = httpCredentials;
return this;
}
/**
* Whether to ignore HTTPS errors when sending network requests. Defaults to {@code false}.
*/
public NewContextOptions setIgnoreHTTPSErrors(boolean ignoreHTTPSErrors) {
public NewContextOptions setIgnoreHTTPSErrors(@Nullable Boolean ignoreHTTPSErrors) {
this.ignoreHTTPSErrors = ignoreHTTPSErrors;
return this;
}
Expand All @@ -211,7 +211,7 @@ public NewContextOptions setIgnoreHTTPSErrors(boolean ignoreHTTPSErrors) {
* exceeded. Defaults to {@code 20}. Pass {@code 0} to not follow redirects. This can be overwritten for each request
* individually.
*/
public NewContextOptions setMaxRedirects(int maxRedirects) {
public NewContextOptions setMaxRedirects(@Nullable Integer maxRedirects) {
this.maxRedirects = maxRedirects;
return this;
}
Expand All @@ -224,7 +224,7 @@ public NewContextOptions setProxy(String server) {
/**
* Network proxy settings.
*/
public NewContextOptions setProxy(Proxy proxy) {
public NewContextOptions setProxy(@Nullable Proxy proxy) {
this.proxy = proxy;
return this;
}
Expand All @@ -236,7 +236,7 @@ public NewContextOptions setProxy(Proxy proxy) {
* BrowserContext.storageState()} or {@link com.microsoft.playwright.APIRequestContext#storageState
* APIRequestContext.storageState()} methods.
*/
public NewContextOptions setStorageState(String storageState) {
public NewContextOptions setStorageState(@Nullable String storageState) {
this.storageState = storageState;
return this;
}
Expand All @@ -245,22 +245,22 @@ public NewContextOptions setStorageState(String storageState) {
* obtained via {@link com.microsoft.playwright.BrowserContext#storageState BrowserContext.storageState()}. Path to the
* file with saved storage state.
*/
public NewContextOptions setStorageStatePath(Path storageStatePath) {
public NewContextOptions setStorageStatePath(@Nullable Path storageStatePath) {
this.storageStatePath = storageStatePath;
return this;
}
/**
* Maximum time in milliseconds to wait for the response. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable
* timeout.
*/
public NewContextOptions setTimeout(double timeout) {
public NewContextOptions setTimeout(@Nullable Double timeout) {
this.timeout = timeout;
return this;
}
/**
* Specific user agent to use in this context.
*/
public NewContextOptions setUserAgent(String userAgent) {
public NewContextOptions setUserAgent(@Nullable String userAgent) {
this.userAgent = userAgent;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class DisposeOptions {
/**
* The reason to be reported to the operations interrupted by the context disposal.
*/
public DisposeOptions setReason(String reason) {
public DisposeOptions setReason(@Nullable String reason) {
this.reason = reason;
return this;
}
Expand All @@ -75,22 +75,22 @@ class StorageStateOptions {
/**
* Set to {@code true} to include IndexedDB in the storage state snapshot.
*/
public StorageStateOptions setIndexedDB(boolean indexedDB) {
public StorageStateOptions setIndexedDB(@Nullable Boolean indexedDB) {
this.indexedDB = indexedDB;
return this;
}
/**
* Set to {@code true} to include the origin private file system in the storage state snapshot.
*/
public StorageStateOptions setOpfs(boolean opfs) {
public StorageStateOptions setOpfs(@Nullable Boolean opfs) {
this.opfs = opfs;
return this;
}
/**
* The file path to save the storage state to. If {@code path} is a relative path, then it is resolved relative to current
* working directory. If no path is provided, storage state is still returned, but won't be saved to the disk.
*/
public StorageStateOptions setPath(Path path) {
public StorageStateOptions setPath(@Nullable Path path) {
this.path = path;
return this;
}
Expand Down
Loading