Skip to content

Commit 10da11c

Browse files
authored
chore: update javadocs to reference set* methods (#328)
1 parent 71b5865 commit 10da11c

File tree

8 files changed

+87
-87
lines changed

8 files changed

+87
-87
lines changed

playwright/src/main/java/com/microsoft/playwright/BrowserContext.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ default List<Cookie> cookies() {
256256
* public static void main(String[] args) {
257257
* try (Playwright playwright = Playwright.create()) {
258258
* BrowserType webkit = playwright.webkit()
259-
* Browser browser = webkit.launch(new BrowserType.LaunchOptions().withHeadless(false));
259+
* Browser browser = webkit.launch(new BrowserType.LaunchOptions().setHeadless(false));
260260
* BrowserContext context = browser.newContext();
261261
* context.exposeBinding("pageURL", (source, args) -> source.page().url());
262262
* Page page = context.newPage();
@@ -279,7 +279,7 @@ default List<Cookie> cookies() {
279279
* ElementHandle element = (ElementHandle) args[0];
280280
* System.out.println(element.textContent());
281281
* return null;
282-
* }, new BrowserContext.ExposeBindingOptions().withHandle(true));
282+
* }, new BrowserContext.ExposeBindingOptions().setHandle(true));
283283
* page.setContent("" +
284284
* "<script>\n" +
285285
* " document.addEventListener('click', event => window.clicked(event.target));\n" +
@@ -315,7 +315,7 @@ default void exposeBinding(String name, BindingCallback callback) {
315315
* public static void main(String[] args) {
316316
* try (Playwright playwright = Playwright.create()) {
317317
* BrowserType webkit = playwright.webkit()
318-
* Browser browser = webkit.launch(new BrowserType.LaunchOptions().withHeadless(false));
318+
* Browser browser = webkit.launch(new BrowserType.LaunchOptions().setHeadless(false));
319319
* BrowserContext context = browser.newContext();
320320
* context.exposeBinding("pageURL", (source, args) -> source.page().url());
321321
* Page page = context.newPage();
@@ -338,7 +338,7 @@ default void exposeBinding(String name, BindingCallback callback) {
338338
* ElementHandle element = (ElementHandle) args[0];
339339
* System.out.println(element.textContent());
340340
* return null;
341-
* }, new BrowserContext.ExposeBindingOptions().withHandle(true));
341+
* }, new BrowserContext.ExposeBindingOptions().setHandle(true));
342342
* page.setContent("" +
343343
* "<script>\n" +
344344
* " document.addEventListener('click', event => window.clicked(event.target));\n" +
@@ -376,7 +376,7 @@ default void exposeBinding(String name, BindingCallback callback) {
376376
* public static void main(String[] args) {
377377
* try (Playwright playwright = Playwright.create()) {
378378
* BrowserType webkit = playwright.webkit()
379-
* Browser browser = webkit.launch(new BrowserType.LaunchOptions().withHeadless(false));
379+
* Browser browser = webkit.launch(new BrowserType.LaunchOptions().setHeadless(false));
380380
* context.exposeFunction("sha1", args -> {
381381
* String text = (String) args[0];
382382
* MessageDigest crypto;

playwright/src/main/java/com/microsoft/playwright/BrowserType.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ default Browser connect(String wsEndpoint) {
556556
* <pre>{@code
557557
* // Or "firefox" or "webkit".
558558
* Browser browser = chromium.launch(new BrowserType.LaunchOptions()
559-
* .withIgnoreDefaultArgs(Arrays.asList("--mute-audio")));
559+
* .setIgnoreDefaultArgs(Arrays.asList("--mute-audio")));
560560
* }</pre>
561561
*
562562
* <p> > **Chromium-only** Playwright can also be used to control the Google Chrome or Microsoft Edge browsers, but it works
@@ -588,7 +588,7 @@ default Browser launch() {
588588
* <pre>{@code
589589
* // Or "firefox" or "webkit".
590590
* Browser browser = chromium.launch(new BrowserType.LaunchOptions()
591-
* .withIgnoreDefaultArgs(Arrays.asList("--mute-audio")));
591+
* .setIgnoreDefaultArgs(Arrays.asList("--mute-audio")));
592592
* }</pre>
593593
*
594594
* <p> > **Chromium-only** Playwright can also be used to control the Google Chrome or Microsoft Edge browsers, but it works

playwright/src/main/java/com/microsoft/playwright/ElementHandle.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,7 @@ default void scrollIntoViewIfNeeded() {
11301130
* // single selection matching the value
11311131
* handle.selectOption("blue");
11321132
* // single selection matching the label
1133-
* handle.selectOption(new SelectOption().withLabel("Blue"));
1133+
* handle.selectOption(new SelectOption().setLabel("Blue"));
11341134
* // multiple selection
11351135
* handle.selectOption(new String[] {"red", "green", "blue"});
11361136
* }</pre>
@@ -1153,7 +1153,7 @@ default List<String> selectOption(String values) {
11531153
* // single selection matching the value
11541154
* handle.selectOption("blue");
11551155
* // single selection matching the label
1156-
* handle.selectOption(new SelectOption().withLabel("Blue"));
1156+
* handle.selectOption(new SelectOption().setLabel("Blue"));
11571157
* // multiple selection
11581158
* handle.selectOption(new String[] {"red", "green", "blue"});
11591159
* }</pre>
@@ -1174,7 +1174,7 @@ default List<String> selectOption(String values) {
11741174
* // single selection matching the value
11751175
* handle.selectOption("blue");
11761176
* // single selection matching the label
1177-
* handle.selectOption(new SelectOption().withLabel("Blue"));
1177+
* handle.selectOption(new SelectOption().setLabel("Blue"));
11781178
* // multiple selection
11791179
* handle.selectOption(new String[] {"red", "green", "blue"});
11801180
* }</pre>
@@ -1197,7 +1197,7 @@ default List<String> selectOption(ElementHandle values) {
11971197
* // single selection matching the value
11981198
* handle.selectOption("blue");
11991199
* // single selection matching the label
1200-
* handle.selectOption(new SelectOption().withLabel("Blue"));
1200+
* handle.selectOption(new SelectOption().setLabel("Blue"));
12011201
* // multiple selection
12021202
* handle.selectOption(new String[] {"red", "green", "blue"});
12031203
* }</pre>
@@ -1218,7 +1218,7 @@ default List<String> selectOption(ElementHandle values) {
12181218
* // single selection matching the value
12191219
* handle.selectOption("blue");
12201220
* // single selection matching the label
1221-
* handle.selectOption(new SelectOption().withLabel("Blue"));
1221+
* handle.selectOption(new SelectOption().setLabel("Blue"));
12221222
* // multiple selection
12231223
* handle.selectOption(new String[] {"red", "green", "blue"});
12241224
* }</pre>
@@ -1241,7 +1241,7 @@ default List<String> selectOption(String[] values) {
12411241
* // single selection matching the value
12421242
* handle.selectOption("blue");
12431243
* // single selection matching the label
1244-
* handle.selectOption(new SelectOption().withLabel("Blue"));
1244+
* handle.selectOption(new SelectOption().setLabel("Blue"));
12451245
* // multiple selection
12461246
* handle.selectOption(new String[] {"red", "green", "blue"});
12471247
* }</pre>
@@ -1262,7 +1262,7 @@ default List<String> selectOption(String[] values) {
12621262
* // single selection matching the value
12631263
* handle.selectOption("blue");
12641264
* // single selection matching the label
1265-
* handle.selectOption(new SelectOption().withLabel("Blue"));
1265+
* handle.selectOption(new SelectOption().setLabel("Blue"));
12661266
* // multiple selection
12671267
* handle.selectOption(new String[] {"red", "green", "blue"});
12681268
* }</pre>
@@ -1285,7 +1285,7 @@ default List<String> selectOption(SelectOption values) {
12851285
* // single selection matching the value
12861286
* handle.selectOption("blue");
12871287
* // single selection matching the label
1288-
* handle.selectOption(new SelectOption().withLabel("Blue"));
1288+
* handle.selectOption(new SelectOption().setLabel("Blue"));
12891289
* // multiple selection
12901290
* handle.selectOption(new String[] {"red", "green", "blue"});
12911291
* }</pre>
@@ -1306,7 +1306,7 @@ default List<String> selectOption(SelectOption values) {
13061306
* // single selection matching the value
13071307
* handle.selectOption("blue");
13081308
* // single selection matching the label
1309-
* handle.selectOption(new SelectOption().withLabel("Blue"));
1309+
* handle.selectOption(new SelectOption().setLabel("Blue"));
13101310
* // multiple selection
13111311
* handle.selectOption(new String[] {"red", "green", "blue"});
13121312
* }</pre>
@@ -1329,7 +1329,7 @@ default List<String> selectOption(ElementHandle[] values) {
13291329
* // single selection matching the value
13301330
* handle.selectOption("blue");
13311331
* // single selection matching the label
1332-
* handle.selectOption(new SelectOption().withLabel("Blue"));
1332+
* handle.selectOption(new SelectOption().setLabel("Blue"));
13331333
* // multiple selection
13341334
* handle.selectOption(new String[] {"red", "green", "blue"});
13351335
* }</pre>
@@ -1350,7 +1350,7 @@ default List<String> selectOption(ElementHandle[] values) {
13501350
* // single selection matching the value
13511351
* handle.selectOption("blue");
13521352
* // single selection matching the label
1353-
* handle.selectOption(new SelectOption().withLabel("Blue"));
1353+
* handle.selectOption(new SelectOption().setLabel("Blue"));
13541354
* // multiple selection
13551355
* handle.selectOption(new String[] {"red", "green", "blue"});
13561356
* }</pre>
@@ -1373,7 +1373,7 @@ default List<String> selectOption(SelectOption[] values) {
13731373
* // single selection matching the value
13741374
* handle.selectOption("blue");
13751375
* // single selection matching the label
1376-
* handle.selectOption(new SelectOption().withLabel("Blue"));
1376+
* handle.selectOption(new SelectOption().setLabel("Blue"));
13771377
* // multiple selection
13781378
* handle.selectOption(new String[] {"red", "green", "blue"});
13791379
* }</pre>
@@ -1515,7 +1515,7 @@ default void tap() {
15151515
* <p> To press a special key, like {@code Control} or {@code ArrowDown}, use {@link ElementHandle#press ElementHandle.press()}.
15161516
* <pre>{@code
15171517
* elementHandle.type("Hello"); // Types instantly
1518-
* elementHandle.type("World", new ElementHandle.TypeOptions().withDelay(100)); // Types slower, like a user
1518+
* elementHandle.type("World", new ElementHandle.TypeOptions().setDelay(100)); // Types slower, like a user
15191519
* }</pre>
15201520
*
15211521
* <p> An example of typing into a text field and then submitting the form:
@@ -1536,7 +1536,7 @@ default void type(String text) {
15361536
* <p> To press a special key, like {@code Control} or {@code ArrowDown}, use {@link ElementHandle#press ElementHandle.press()}.
15371537
* <pre>{@code
15381538
* elementHandle.type("Hello"); // Types instantly
1539-
* elementHandle.type("World", new ElementHandle.TypeOptions().withDelay(100)); // Types slower, like a user
1539+
* elementHandle.type("World", new ElementHandle.TypeOptions().setDelay(100)); // Types slower, like a user
15401540
* }</pre>
15411541
*
15421542
* <p> An example of typing into a text field and then submitting the form:
@@ -1652,7 +1652,7 @@ default void waitForElementState(ElementState state) {
16521652
* ElementHandle div = page.querySelector("div");
16531653
* // Waiting for the "span" selector relative to the div.
16541654
* ElementHandle span = div.waitForSelector("span", new ElementHandle.WaitForSelectorOptions()
1655-
* .withState(WaitForSelectorState.ATTACHED));
1655+
* .setState(WaitForSelectorState.ATTACHED));
16561656
* }</pre>
16571657
*
16581658
* <p> <strong>NOTE:</strong> This method does not work across navigations, use {@link Page#waitForSelector Page.waitForSelector()} instead.
@@ -1676,7 +1676,7 @@ default ElementHandle waitForSelector(String selector) {
16761676
* ElementHandle div = page.querySelector("div");
16771677
* // Waiting for the "span" selector relative to the div.
16781678
* ElementHandle span = div.waitForSelector("span", new ElementHandle.WaitForSelectorOptions()
1679-
* .withState(WaitForSelectorState.ATTACHED));
1679+
* .setState(WaitForSelectorState.ATTACHED));
16801680
* }</pre>
16811681
*
16821682
* <p> <strong>NOTE:</strong> This method does not work across navigations, use {@link Page#waitForSelector Page.waitForSelector()} instead.

playwright/src/main/java/com/microsoft/playwright/Frame.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1808,7 +1808,7 @@ default void press(String selector, String key) {
18081808
* // single selection matching the value
18091809
* frame.selectOption("select#colors", "blue");
18101810
* // single selection matching both the value and the label
1811-
* frame.selectOption("select#colors", new SelectOption().withLabel("Blue"));
1811+
* frame.selectOption("select#colors", new SelectOption().setLabel("Blue"));
18121812
* // multiple selection
18131813
* frame.selectOption("select#colors", new String[] {"red", "green", "blue"});
18141814
* }</pre>
@@ -1833,7 +1833,7 @@ default List<String> selectOption(String selector, String values) {
18331833
* // single selection matching the value
18341834
* frame.selectOption("select#colors", "blue");
18351835
* // single selection matching both the value and the label
1836-
* frame.selectOption("select#colors", new SelectOption().withLabel("Blue"));
1836+
* frame.selectOption("select#colors", new SelectOption().setLabel("Blue"));
18371837
* // multiple selection
18381838
* frame.selectOption("select#colors", new String[] {"red", "green", "blue"});
18391839
* }</pre>
@@ -1856,7 +1856,7 @@ default List<String> selectOption(String selector, String values) {
18561856
* // single selection matching the value
18571857
* frame.selectOption("select#colors", "blue");
18581858
* // single selection matching both the value and the label
1859-
* frame.selectOption("select#colors", new SelectOption().withLabel("Blue"));
1859+
* frame.selectOption("select#colors", new SelectOption().setLabel("Blue"));
18601860
* // multiple selection
18611861
* frame.selectOption("select#colors", new String[] {"red", "green", "blue"});
18621862
* }</pre>
@@ -1881,7 +1881,7 @@ default List<String> selectOption(String selector, ElementHandle values) {
18811881
* // single selection matching the value
18821882
* frame.selectOption("select#colors", "blue");
18831883
* // single selection matching both the value and the label
1884-
* frame.selectOption("select#colors", new SelectOption().withLabel("Blue"));
1884+
* frame.selectOption("select#colors", new SelectOption().setLabel("Blue"));
18851885
* // multiple selection
18861886
* frame.selectOption("select#colors", new String[] {"red", "green", "blue"});
18871887
* }</pre>
@@ -1904,7 +1904,7 @@ default List<String> selectOption(String selector, ElementHandle values) {
19041904
* // single selection matching the value
19051905
* frame.selectOption("select#colors", "blue");
19061906
* // single selection matching both the value and the label
1907-
* frame.selectOption("select#colors", new SelectOption().withLabel("Blue"));
1907+
* frame.selectOption("select#colors", new SelectOption().setLabel("Blue"));
19081908
* // multiple selection
19091909
* frame.selectOption("select#colors", new String[] {"red", "green", "blue"});
19101910
* }</pre>
@@ -1929,7 +1929,7 @@ default List<String> selectOption(String selector, String[] values) {
19291929
* // single selection matching the value
19301930
* frame.selectOption("select#colors", "blue");
19311931
* // single selection matching both the value and the label
1932-
* frame.selectOption("select#colors", new SelectOption().withLabel("Blue"));
1932+
* frame.selectOption("select#colors", new SelectOption().setLabel("Blue"));
19331933
* // multiple selection
19341934
* frame.selectOption("select#colors", new String[] {"red", "green", "blue"});
19351935
* }</pre>
@@ -1952,7 +1952,7 @@ default List<String> selectOption(String selector, String[] values) {
19521952
* // single selection matching the value
19531953
* frame.selectOption("select#colors", "blue");
19541954
* // single selection matching both the value and the label
1955-
* frame.selectOption("select#colors", new SelectOption().withLabel("Blue"));
1955+
* frame.selectOption("select#colors", new SelectOption().setLabel("Blue"));
19561956
* // multiple selection
19571957
* frame.selectOption("select#colors", new String[] {"red", "green", "blue"});
19581958
* }</pre>
@@ -1977,7 +1977,7 @@ default List<String> selectOption(String selector, SelectOption values) {
19771977
* // single selection matching the value
19781978
* frame.selectOption("select#colors", "blue");
19791979
* // single selection matching both the value and the label
1980-
* frame.selectOption("select#colors", new SelectOption().withLabel("Blue"));
1980+
* frame.selectOption("select#colors", new SelectOption().setLabel("Blue"));
19811981
* // multiple selection
19821982
* frame.selectOption("select#colors", new String[] {"red", "green", "blue"});
19831983
* }</pre>
@@ -2000,7 +2000,7 @@ default List<String> selectOption(String selector, SelectOption values) {
20002000
* // single selection matching the value
20012001
* frame.selectOption("select#colors", "blue");
20022002
* // single selection matching both the value and the label
2003-
* frame.selectOption("select#colors", new SelectOption().withLabel("Blue"));
2003+
* frame.selectOption("select#colors", new SelectOption().setLabel("Blue"));
20042004
* // multiple selection
20052005
* frame.selectOption("select#colors", new String[] {"red", "green", "blue"});
20062006
* }</pre>
@@ -2025,7 +2025,7 @@ default List<String> selectOption(String selector, ElementHandle[] values) {
20252025
* // single selection matching the value
20262026
* frame.selectOption("select#colors", "blue");
20272027
* // single selection matching both the value and the label
2028-
* frame.selectOption("select#colors", new SelectOption().withLabel("Blue"));
2028+
* frame.selectOption("select#colors", new SelectOption().setLabel("Blue"));
20292029
* // multiple selection
20302030
* frame.selectOption("select#colors", new String[] {"red", "green", "blue"});
20312031
* }</pre>
@@ -2048,7 +2048,7 @@ default List<String> selectOption(String selector, ElementHandle[] values) {
20482048
* // single selection matching the value
20492049
* frame.selectOption("select#colors", "blue");
20502050
* // single selection matching both the value and the label
2051-
* frame.selectOption("select#colors", new SelectOption().withLabel("Blue"));
2051+
* frame.selectOption("select#colors", new SelectOption().setLabel("Blue"));
20522052
* // multiple selection
20532053
* frame.selectOption("select#colors", new String[] {"red", "green", "blue"});
20542054
* }</pre>
@@ -2073,7 +2073,7 @@ default List<String> selectOption(String selector, SelectOption[] values) {
20732073
* // single selection matching the value
20742074
* frame.selectOption("select#colors", "blue");
20752075
* // single selection matching both the value and the label
2076-
* frame.selectOption("select#colors", new SelectOption().withLabel("Blue"));
2076+
* frame.selectOption("select#colors", new SelectOption().setLabel("Blue"));
20772077
* // multiple selection
20782078
* frame.selectOption("select#colors", new String[] {"red", "green", "blue"});
20792079
* }</pre>
@@ -2266,7 +2266,7 @@ default String textContent(String selector) {
22662266
* // Types instantly
22672267
* frame.type("#mytextarea", "Hello");
22682268
* // Types slower, like a user
2269-
* frame.type("#mytextarea", "World", new Frame.TypeOptions().withDelay(100));
2269+
* frame.type("#mytextarea", "World", new Frame.TypeOptions().setDelay(100));
22702270
* }</pre>
22712271
*
22722272
* @param selector A selector to search for element. If there are multiple elements satisfying the selector, the first will be used. See <a
@@ -2285,7 +2285,7 @@ default void type(String selector, String text) {
22852285
* // Types instantly
22862286
* frame.type("#mytextarea", "Hello");
22872287
* // Types slower, like a user
2288-
* frame.type("#mytextarea", "World", new Frame.TypeOptions().withDelay(100));
2288+
* frame.type("#mytextarea", "World", new Frame.TypeOptions().setDelay(100));
22892289
* }</pre>
22902290
*
22912291
* @param selector A selector to search for element. If there are multiple elements satisfying the selector, the first will be used. See <a

0 commit comments

Comments
 (0)