@@ -17,54 +17,11 @@ public static <T> org.hamcrest.Matcher<T> allOf(java.lang.Iterable<org.hamcrest.
17
17
* For example:
18
18
* <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre>
19
19
*/
20
+ @ SafeVarargs
20
21
public static <T > org .hamcrest .Matcher <T > allOf (org .hamcrest .Matcher <? super T >... matchers ) {
21
22
return org .hamcrest .core .AllOf .allOf (matchers );
22
23
}
23
24
24
- /**
25
- * Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers.
26
- * For example:
27
- * <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre>
28
- */
29
- public static <T > org .hamcrest .Matcher <T > allOf (org .hamcrest .Matcher <? super T > first , org .hamcrest .Matcher <? super T > second ) {
30
- return org .hamcrest .core .AllOf .allOf (first , second );
31
- }
32
-
33
- /**
34
- * Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers.
35
- * For example:
36
- * <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre>
37
- */
38
- public static <T > org .hamcrest .Matcher <T > allOf (org .hamcrest .Matcher <? super T > first , org .hamcrest .Matcher <? super T > second , org .hamcrest .Matcher <? super T > third ) {
39
- return org .hamcrest .core .AllOf .allOf (first , second , third );
40
- }
41
-
42
- /**
43
- * Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers.
44
- * For example:
45
- * <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre>
46
- */
47
- public static <T > org .hamcrest .Matcher <T > allOf (org .hamcrest .Matcher <? super T > first , org .hamcrest .Matcher <? super T > second , org .hamcrest .Matcher <? super T > third , org .hamcrest .Matcher <? super T > fourth ) {
48
- return org .hamcrest .core .AllOf .allOf (first , second , third , fourth );
49
- }
50
-
51
- /**
52
- * Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers.
53
- * For example:
54
- * <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre>
55
- */
56
- public static <T > org .hamcrest .Matcher <T > allOf (org .hamcrest .Matcher <? super T > first , org .hamcrest .Matcher <? super T > second , org .hamcrest .Matcher <? super T > third , org .hamcrest .Matcher <? super T > fourth , org .hamcrest .Matcher <? super T > fifth ) {
57
- return org .hamcrest .core .AllOf .allOf (first , second , third , fourth , fifth );
58
- }
59
-
60
- /**
61
- * Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers.
62
- * For example:
63
- * <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre>
64
- */
65
- public static <T > org .hamcrest .Matcher <T > allOf (org .hamcrest .Matcher <? super T > first , org .hamcrest .Matcher <? super T > second , org .hamcrest .Matcher <? super T > third , org .hamcrest .Matcher <? super T > fourth , org .hamcrest .Matcher <? super T > fifth , org .hamcrest .Matcher <? super T > sixth ) {
66
- return org .hamcrest .core .AllOf .allOf (first , second , third , fourth , fifth , sixth );
67
- }
68
25
69
26
/**
70
27
* Creates a matcher that matches if the examined object matches <b>ANY</b> of the specified matchers.
@@ -80,55 +37,11 @@ public static <T> org.hamcrest.core.AnyOf<T> anyOf(java.lang.Iterable<org.hamcre
80
37
* For example:
81
38
* <pre>assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))</pre>
82
39
*/
40
+ @ SafeVarargs
83
41
public static <T > org .hamcrest .core .AnyOf <T > anyOf (org .hamcrest .Matcher <? super T >... matchers ) {
84
42
return org .hamcrest .core .AnyOf .anyOf (matchers );
85
43
}
86
44
87
- /**
88
- * Creates a matcher that matches if the examined object matches <b>ANY</b> of the specified matchers.
89
- * For example:
90
- * <pre>assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))</pre>
91
- */
92
- public static <T > org .hamcrest .core .AnyOf <T > anyOf (org .hamcrest .Matcher <T > first , org .hamcrest .Matcher <? super T > second ) {
93
- return org .hamcrest .core .AnyOf .anyOf (first , second );
94
- }
95
-
96
- /**
97
- * Creates a matcher that matches if the examined object matches <b>ANY</b> of the specified matchers.
98
- * For example:
99
- * <pre>assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))</pre>
100
- */
101
- public static <T > org .hamcrest .core .AnyOf <T > anyOf (org .hamcrest .Matcher <T > first , org .hamcrest .Matcher <? super T > second , org .hamcrest .Matcher <? super T > third ) {
102
- return org .hamcrest .core .AnyOf .anyOf (first , second , third );
103
- }
104
-
105
- /**
106
- * Creates a matcher that matches if the examined object matches <b>ANY</b> of the specified matchers.
107
- * For example:
108
- * <pre>assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))</pre>
109
- */
110
- public static <T > org .hamcrest .core .AnyOf <T > anyOf (org .hamcrest .Matcher <T > first , org .hamcrest .Matcher <? super T > second , org .hamcrest .Matcher <? super T > third , org .hamcrest .Matcher <? super T > fourth ) {
111
- return org .hamcrest .core .AnyOf .anyOf (first , second , third , fourth );
112
- }
113
-
114
- /**
115
- * Creates a matcher that matches if the examined object matches <b>ANY</b> of the specified matchers.
116
- * For example:
117
- * <pre>assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))</pre>
118
- */
119
- public static <T > org .hamcrest .core .AnyOf <T > anyOf (org .hamcrest .Matcher <T > first , org .hamcrest .Matcher <? super T > second , org .hamcrest .Matcher <? super T > third , org .hamcrest .Matcher <? super T > fourth , org .hamcrest .Matcher <? super T > fifth ) {
120
- return org .hamcrest .core .AnyOf .anyOf (first , second , third , fourth , fifth );
121
- }
122
-
123
- /**
124
- * Creates a matcher that matches if the examined object matches <b>ANY</b> of the specified matchers.
125
- * For example:
126
- * <pre>assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))</pre>
127
- */
128
- public static <T > org .hamcrest .core .AnyOf <T > anyOf (org .hamcrest .Matcher <T > first , org .hamcrest .Matcher <? super T > second , org .hamcrest .Matcher <? super T > third , org .hamcrest .Matcher <? super T > fourth , org .hamcrest .Matcher <? super T > fifth , org .hamcrest .Matcher <? super T > sixth ) {
129
- return org .hamcrest .core .AnyOf .anyOf (first , second , third , fourth , fifth , sixth );
130
- }
131
-
132
45
/**
133
46
* Creates a matcher that matches when both of the specified matchers match the examined object.
134
47
* For example:
@@ -271,6 +184,7 @@ public static <T> org.hamcrest.Matcher<java.lang.Iterable<? super T>> hasItem(T
271
184
* @param itemMatchers
272
185
* the matchers to apply to items provided by the examined {@link Iterable}
273
186
*/
187
+ @ SafeVarargs
274
188
public static <T > org .hamcrest .Matcher <java .lang .Iterable <T >> hasItems (org .hamcrest .Matcher <? super T >... itemMatchers ) {
275
189
return org .hamcrest .core .IsCollectionContaining .hasItems (itemMatchers );
276
190
}
@@ -286,6 +200,7 @@ public static <T> org.hamcrest.Matcher<java.lang.Iterable<T>> hasItems(org.hamcr
286
200
* @param items
287
201
* the items to compare against the items provided by the examined {@link Iterable}
288
202
*/
203
+ @ SafeVarargs
289
204
public static <T > org .hamcrest .Matcher <java .lang .Iterable <T >> hasItems (T ... items ) {
290
205
return org .hamcrest .core .IsCollectionContaining .hasItems (items );
291
206
}
0 commit comments