Skip to content

Commit 918b219

Browse files
committed
14035: Add 'toJson' method to produce expected serialization
1 parent 98c6eb0 commit 918b219

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

java/src/org/openqa/selenium/Rectangle.java

+6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
package org.openqa.selenium;
1919

20+
import java.util.Map;
2021
import java.util.Objects;
2122

2223
public class Rectangle {
@@ -64,6 +65,11 @@ public Dimension getDimension() {
6465
return new Dimension(width, height);
6566
}
6667

68+
private Map<String, Object> toJson() {
69+
return Map.of("class", getClass().getName(),
70+
"width", width, "height", height, "x", x, "y", y);
71+
}
72+
6773
@Override
6874
public boolean equals(Object o) {
6975
if (this == o) {

0 commit comments

Comments
 (0)