Skip to content

Commit f9cb9af

Browse files
committed
Remote guava dependency on core interfaces
1 parent 34d6047 commit f9cb9af

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

java/client/src/org/openqa/selenium/BUCK

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ java_library(name = 'core',
6060
'//java/client/src/org/openqa/selenium/interactions:exceptions',
6161
'//java/client/src/org/openqa/selenium/logging:api',
6262
'//java/client/src/org/openqa/selenium/security:security',
63-
'//third_party/java/guava:guava',
6463
],
6564
visibility = [
6665
'//java/client/src/org/openqa/selenium/interactions:interactions',

java/client/src/org/openqa/selenium/DeviceRotation.java

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@
1717

1818
package org.openqa.selenium;
1919

20+
import java.util.Collections;
21+
import java.util.HashMap;
2022
import java.util.Map;
21-
import com.google.common.collect.ImmutableMap;
2223

2324
/**
2425
* Defines an object which represents the three dimensional plane and how a device can be rotated about it.
2526
* Each of the axis is in positive degrees on the real number scale (0 <= deg <= 360).
26-
*
27+
*
2728
* Example Instantiation to rotate device to "Landscape Right":
2829
* DeviceRotation(0, 0, 90);
2930
*/
@@ -43,11 +44,11 @@ public DeviceRotation(int x, int y, int z) {
4344
this.x = x;
4445
this.y = y;
4546
this.z = z;
46-
this.validateParameters(this.x, this.y, this.z);
47+
this.validateParameters(this.x, this.y, this.z);
4748
}
48-
49+
4950
/**
50-
* Instantiate a DeviceRotation object based on a
51+
* Instantiate a DeviceRotation object based on a
5152
* HashMap object where the keys are the axis x, y, and z respectively:
5253
* x : xVal
5354
* y : yVal
@@ -63,15 +64,15 @@ public DeviceRotation(Map<String, Number> map) {
6364
this.z = map.get("z").intValue();
6465
this.validateParameters(x, y, z);
6566
}
66-
67+
6768
private void validateParameters(int x, int y, int z) {
6869
if (x < 0 || y < 0 || z < 0) {
6970
throw new IllegalArgumentException("DeviceRotation requires positive axis values: \nx = " + x + "\ny = " + y + "\nz = " + z);
7071
} else if (x >= 360 || y >= 360 || z >= 360) {
7172
throw new IllegalArgumentException("DeviceRotation requires positive axis values under 360: \nx = " + x + "\ny = " + y + "\nz = " + z);
7273
}
7374
}
74-
75+
7576
/**
7677
* @return the x
7778
*/
@@ -94,22 +95,26 @@ public int getZ() {
9495
}
9596

9697
/**
97-
* @return returns all axis mapped to an ImmutableMap
98+
* @return returns all axis mapped to a Map
9899
*/
99-
public ImmutableMap<String,Integer> parameters() {
100-
return ImmutableMap.of("x", this.x, "y", this.y, "z", this.z);
100+
public Map<String,Integer> parameters() {
101+
HashMap<String, Integer> values = new HashMap<>();
102+
values.put("x", this.x);
103+
values.put("y", this.y);
104+
values.put("z", this.z);
105+
return Collections.unmodifiableMap(values);
101106
}
102-
107+
103108
@Override
104-
public boolean equals(Object o)
109+
public boolean equals(Object o)
105110
{
106111
if (!(o instanceof DeviceRotation)) {
107112
return false;
108113
}
109114
if (o == this) {
110115
return true;
111116
}
112-
117+
113118
DeviceRotation obj = (DeviceRotation)o;
114119
if (obj.getX() != this.getX() || obj.getY() != this.getY() || obj.getZ() != this.getZ()) {
115120
return false;

0 commit comments

Comments
 (0)