Skip to content

Commit c9b2a70

Browse files
committed
Update Iterables.
1 parent f244e0e commit c9b2a70

2 files changed

Lines changed: 16 additions & 16 deletions

File tree

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,20 +1140,20 @@ public static <T, K extends Comparable<? super K>> Iterable<Map.Entry<K, List<T>
11401140

11411141
public static <T> boolean exists(Iterable<T> iterable, Predicate<? super T> predicate) { ... }
11421142

1143-
public static <T, U extends Comparable<? super U>> Predicate<? super T> whereEqualTo(Function<? super T, U> transform, U value) { ... }
1144-
public static <T, U extends Comparable<? super U>> Predicate<? super T> whereNotEqualTo(Function<? super T, U> transform, U value) { ... }
1143+
public static <T, U extends Comparable<? super U>> Predicate<T> whereEqualTo(Function<? super T, U> transform, U value) { ... }
1144+
public static <T, U extends Comparable<? super U>> Predicate<T> whereNotEqualTo(Function<? super T, U> transform, U value) { ... }
11451145
public static <T, U extends Comparable<? super U>> Predicate<T> whereGreaterThan(Function<? super T, U> transform, U value) { ... }
11461146
public static <T, U extends Comparable<? super U>> Predicate<T> whereGreaterThanOrEqualTo(Function<? super T, U> transform, U value) { ... }
11471147
public static <T, U extends Comparable<? super U>> Predicate<T> whereLessThan(Function<? super T, U> transform, U value) { ... }
11481148
public static <T, U extends Comparable<? super U>> Predicate<T> whereLessThanOrEqualTo(Function<? super T, U> transform, U value) { ... }
11491149

1150-
public static <T> Predicate<? super T> whereStartsWith(Function<? super T, String> transform, String value) { ... }
1151-
public static <T> Predicate<? super T> whereEndsWith(Function<? super T, String> transform, String value) { ... }
1152-
public static <T> Predicate<? super T> whereContains(Function<? super T, String> transform, String value) { ... }
1153-
public static <T> Predicate<? super T> whereNotEmpty(Function<? super T, String> transform) { ... }
1150+
public static <T> Predicate<T> whereStartsWith(Function<? super T, String> transform, String value) { ... }
1151+
public static <T> Predicate<T> whereEndsWith(Function<? super T, String> transform, String value) { ... }
1152+
public static <T> Predicate<T> whereContains(Function<? super T, String> transform, String value) { ... }
1153+
public static <T> Predicate<T> whereNotEmpty(Function<? super T, String> transform) { ... }
11541154

1155-
public static <T> Predicate<? super T> whereTrue(Function<? super T, Boolean> transform) { ... }
1156-
public static <T> Predicate<? super T> whereFalse(Function<? super T, Boolean> transform) { ... }
1155+
public static <T> Predicate<T> whereTrue(Function<? super T, Boolean> transform) { ... }
1156+
public static <T> Predicate<T> whereFalse(Function<? super T, Boolean> transform) { ... }
11571157
```
11581158

11591159
These are provided as a less complex alternative to similar methods defined by the `java.util.stream.Stream` class:

kilo-client/src/main/java/org/httprpc/kilo/util/Iterables.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ public static <T> boolean exists(Iterable<T> iterable, Predicate<? super T> pred
239239
* @return
240240
* The comparison predicate.
241241
*/
242-
public static <T, U extends Comparable<? super U>> Predicate<? super T> whereEqualTo(Function<? super T, U> transform, U value) {
242+
public static <T, U extends Comparable<? super U>> Predicate<T> whereEqualTo(Function<? super T, U> transform, U value) {
243243
if (transform == null || value == null) {
244244
throw new IllegalArgumentException();
245245
}
@@ -265,7 +265,7 @@ public static <T, U extends Comparable<? super U>> Predicate<? super T> whereEqu
265265
* @return
266266
* The comparison predicate.
267267
*/
268-
public static <T, U extends Comparable<? super U>> Predicate<? super T> whereNotEqualTo(Function<? super T, U> transform, U value) {
268+
public static <T, U extends Comparable<? super U>> Predicate<T> whereNotEqualTo(Function<? super T, U> transform, U value) {
269269
return element -> element != null && transform.apply(element).compareTo(value) != 0;
270270
}
271271

@@ -388,7 +388,7 @@ public static <T, U extends Comparable<? super U>> Predicate<T> whereLessThanOrE
388388
* @return
389389
* The comparison predicate.
390390
*/
391-
public static <T> Predicate<? super T> whereStartsWith(Function<? super T, String> transform, String value) {
391+
public static <T> Predicate<T> whereStartsWith(Function<? super T, String> transform, String value) {
392392
if (transform == null || value == null) {
393393
throw new IllegalArgumentException();
394394
}
@@ -411,7 +411,7 @@ public static <T> Predicate<? super T> whereStartsWith(Function<? super T, Strin
411411
* @return
412412
* The comparison predicate.
413413
*/
414-
public static <T> Predicate<? super T> whereEndsWith(Function<? super T, String> transform, String value) {
414+
public static <T> Predicate<T> whereEndsWith(Function<? super T, String> transform, String value) {
415415
if (transform == null || value == null) {
416416
throw new IllegalArgumentException();
417417
}
@@ -434,7 +434,7 @@ public static <T> Predicate<? super T> whereEndsWith(Function<? super T, String>
434434
* @return
435435
* The comparison predicate.
436436
*/
437-
public static <T> Predicate<? super T> whereContains(Function<? super T, String> transform, String value) {
437+
public static <T> Predicate<T> whereContains(Function<? super T, String> transform, String value) {
438438
if (transform == null || value == null) {
439439
throw new IllegalArgumentException();
440440
}
@@ -454,7 +454,7 @@ public static <T> Predicate<? super T> whereContains(Function<? super T, String>
454454
* @return
455455
* The comparison predicate.
456456
*/
457-
public static <T> Predicate<? super T> whereNotEmpty(Function<? super T, String> transform) {
457+
public static <T> Predicate<T> whereNotEmpty(Function<? super T, String> transform) {
458458
if (transform == null) {
459459
throw new IllegalArgumentException();
460460
}
@@ -474,7 +474,7 @@ public static <T> Predicate<? super T> whereNotEmpty(Function<? super T, String>
474474
* @return
475475
* The comparison predicate.
476476
*/
477-
public static <T> Predicate<? super T> whereTrue(Function<? super T, Boolean> transform) {
477+
public static <T> Predicate<T> whereTrue(Function<? super T, Boolean> transform) {
478478
if (transform == null) {
479479
throw new IllegalArgumentException();
480480
}
@@ -494,7 +494,7 @@ public static <T> Predicate<? super T> whereTrue(Function<? super T, Boolean> tr
494494
* @return
495495
* The comparison predicate.
496496
*/
497-
public static <T> Predicate<? super T> whereFalse(Function<? super T, Boolean> transform) {
497+
public static <T> Predicate<T> whereFalse(Function<? super T, Boolean> transform) {
498498
return element -> element != null && !transform.apply(element);
499499
}
500500

0 commit comments

Comments
 (0)