11package io .appium .java_client .touch .offset ;
22
3- import static com .google .common .base .Preconditions .checkArgument ;
4- import static java .lang .String .format ;
53import static java .util .Optional .ofNullable ;
64
75import io .appium .java_client .touch .ActionOptions ;
@@ -13,8 +11,6 @@ public class PointOption<T extends PointOption<T>> extends ActionOptions<T> {
1311
1412 protected Point coordinates ;
1513
16- private static final String ERROR_MESSAGE_TEMPLATE = "%s coordinate value should be equal or greater than zero" ;
17-
1814 /**
1915 * It creates a built instance of {@link PointOption} which takes x and y coordinates.
2016 * This is offset from the upper left corner of the screen.
@@ -36,14 +32,14 @@ public static PointOption point(int xOffset, int yOffset) {
3632 * @return self-reference
3733 */
3834 public T withCoordinates (int xOffset , int yOffset ) {
39- checkArgument (xOffset >= 0 , format (ERROR_MESSAGE_TEMPLATE , "X" ));
40- checkArgument (yOffset >= 0 , format (ERROR_MESSAGE_TEMPLATE , "Y" ));
4135 coordinates = new Point (xOffset , yOffset );
36+ //noinspection unchecked
4237 return (T ) this ;
4338 }
4439
4540 @ Override
4641 protected void verify () {
42+ //noinspection ResultOfMethodCallIgnored
4743 ofNullable (coordinates ).orElseThrow (() -> new IllegalArgumentException (
4844 "Coordinate values must be defined" ));
4945 }
0 commit comments