Skip to content

Commit 10a76e4

Browse files
author
jon.m.reid
committed
Switched order of factory methods to clarify the chaining, putting the most primitive one at the top.
1 parent 7a64e23 commit 10a76e4

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

‎hamcrest-core/src/main/java/org/hamcrest/core/AllOf.java‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,20 @@ public void describeTo(Description description) {
2828
describeTo(description, "and");
2929
}
3030

31-
/**
31+
/**
3232
* Evaluates to true only if ALL of the passed in matchers evaluate to true.
3333
*/
3434
@Factory
35-
public static <T> Matcher<T> allOf(Matcher<? super T>... matchers) {
36-
return allOf(Arrays.asList(matchers));
35+
public static <T> Matcher<T> allOf(Iterable<Matcher<? super T>> matchers) {
36+
return new AllOf<T>(matchers);
3737
}
3838

39-
/**
39+
/**
4040
* Evaluates to true only if ALL of the passed in matchers evaluate to true.
4141
*/
4242
@Factory
43-
public static <T> Matcher<T> allOf(Iterable<Matcher<? super T>> matchers) {
44-
return new AllOf<T>(matchers);
43+
public static <T> Matcher<T> allOf(Matcher<? super T>... matchers) {
44+
return allOf(Arrays.asList(matchers));
4545
}
4646

4747
/**

‎hamcrest-core/src/main/java/org/hamcrest/core/AnyOf.java‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,6 @@ public void describeTo(Description description) {
2828
describeTo(description, "or");
2929
}
3030

31-
/**
32-
* Evaluates to true if ANY of the passed in matchers evaluate to true.
33-
*/
34-
@Factory
35-
public static <T> Matcher<T> anyOf(Matcher<? super T>... matchers) {
36-
return anyOf(Arrays.asList(matchers));
37-
}
38-
3931
/**
4032
* Evaluates to true if ANY of the passed in matchers evaluate to true.
4133
*/
@@ -44,6 +36,14 @@ public static <T> Matcher<T> anyOf(Iterable<Matcher<? super T>> matchers) {
4436
return new AnyOf<T>(matchers);
4537
}
4638

39+
/**
40+
* Evaluates to true if ANY of the passed in matchers evaluate to true.
41+
*/
42+
@Factory
43+
public static <T> Matcher<T> anyOf(Matcher<? super T>... matchers) {
44+
return anyOf(Arrays.asList(matchers));
45+
}
46+
4747
/**
4848
* Evaluates to true if ANY of the passed in matchers evaluate to true.
4949
*/

0 commit comments

Comments
 (0)