9
9
/**
10
10
* A class that acts as a container for a value of one of two types. An Either
11
11
* can be either be a "Left", containing a LHS value or a "Right" containing a RHS value,
12
- * but not "none " or "both".
12
+ * but it cannot be "neither " or "both".
13
13
*
14
14
* <p>An Either can be used to express a success or failure case. By convention,
15
- * a Right represents the result of a successful computation,
16
- * and a Left represents some kind of failure value .
15
+ * a Right contains the result of a successful computation,
16
+ * and a Left contains some kind of failure object .
17
17
*
18
18
* @param <L> the type of the LHS value
19
19
* @param <R> the type of the RHS value
@@ -50,9 +50,9 @@ public static <L, R> Either<L, R> right(R value) {
50
50
}
51
51
52
52
/**
53
- * Returns a collector that accumulates the RHS values in the stream into a Right ,
53
+ * Returns a collector that accumulates a Right containing all values in the original order ,
54
54
* if there are no Left instances in the stream.
55
- * If the stream contains a Left, it accumulates a Left containing the first LHS value.
55
+ * If the stream contains a Left, it accumulates a Left containing the first LHS value in the stream .
56
56
*
57
57
* @param <L> the LHS type
58
58
* @param <R> the RHS type
@@ -64,9 +64,10 @@ public static <L, R> Either<L, R> right(R value) {
64
64
}
65
65
66
66
/**
67
- * Returns a collector that accumulates a Right containing all RHS values in the original order,
67
+ * Returns a collector that accumulates a Right containing all values in the original order,
68
68
* if there are no Left instances in the stream.
69
- * If the stream contains a Left, it accumulates a Left containing all LHS values, in the original order.
69
+ * If the stream contains a Left, it accumulates a Left containing all LHS values in the stream,
70
+ * in the original order.
70
71
*
71
72
* @param <L> the LHS type
72
73
* @param <R> the RHS type
0 commit comments