File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
java/client/src/org/openqa/selenium/internal Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 18
18
package org .openqa .selenium .internal ;
19
19
20
20
public class Either <A , B > {
21
- private A left = null ;
22
- private B right = null ;
21
+ private final A left ;
22
+ private final B right ;
23
23
24
24
private Either (A a , B b ) {
25
25
left = a ;
26
26
right = b ;
27
27
}
28
28
29
29
public static <A , B > Either <A , B > left (A a ) {
30
- return new Either <A , B >(a , null );
30
+ return new Either <>(a , null );
31
31
}
32
32
33
- public A left ( ) {
34
- return left ;
33
+ public static < A , B > Either < A , B > right ( B b ) {
34
+ return new Either <>( null , b ) ;
35
35
}
36
36
37
37
public boolean isLeft () {
@@ -42,11 +42,11 @@ public boolean isRight() {
42
42
return right != null ;
43
43
}
44
44
45
- public B right () {
46
- return right ;
45
+ public A left () {
46
+ return left ;
47
47
}
48
48
49
- public static < A , B > Either < A , B > right (B b ) {
50
- return new Either < A , B >( null , b ) ;
49
+ public B right () {
50
+ return right ;
51
51
}
52
52
}
You can’t perform that action at this time.
0 commit comments