-
Notifications
You must be signed in to change notification settings - Fork 87
Expand file tree
/
Copy pathImage.java
More file actions
47 lines (39 loc) · 1.19 KB
/
Image.java
File metadata and controls
47 lines (39 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package objects;
import org.openqa.selenium.WebElement;
import java.util.Objects;
public class Image {
private String src;
private String height;
private String width;
public Image(String src, String height, String width) {
this.src = src;
this.height = height;
this.width = width;
}
public Image(WebElement element) {
this.src = element.getAttribute("src");
this.height = element.getAttribute("height");
this.width = element.getAttribute("width");
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Image image = (Image) o;
return Objects.equals(src, image.src) &&
Objects.equals(height, image.height) &&
Objects.equals(width, image.width);
}
@Override
public int hashCode() {
return Objects.hash(src, height, width);
}
@Override
public String toString() {
return "Image{" +
"src='" + src + '\'' +
", height='" + height + '\'' +
", width='" + width + '\'' +
'}';
}
}