Skip to content

Commit 9fed28c

Browse files
committed
JavaDoc only @return org.hamcrest.core
1 parent 44bb9b9 commit 9fed28c

17 files changed

Lines changed: 55 additions & 0 deletions

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ public void describeTo(Description description) {
4444
* Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers.
4545
* For example:
4646
* <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre>
47+
*
48+
* @return The matcher.
4749
*/
4850
public static <T> Matcher<T> allOf(Iterable<Matcher<? super T>> matchers) {
4951
return new AllOf<>(matchers);
@@ -53,6 +55,8 @@ public static <T> Matcher<T> allOf(Iterable<Matcher<? super T>> matchers) {
5355
* Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers.
5456
* For example:
5557
* <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre>
58+
*
59+
* @return The matcher.
5660
*/
5761
@SafeVarargs
5862
public static <T> Matcher<T> allOf(Matcher<? super T>... matchers) {

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ public void describeTo(Description description) {
3434
* Creates a matcher that matches if the examined object matches <b>ANY</b> of the specified matchers.
3535
* For example:
3636
* <pre>assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))</pre>
37+
*
38+
* @return The matcher.
3739
*/
3840
public static <T> AnyOf<T> anyOf(Iterable<Matcher<? super T>> matchers) {
3941
return new AnyOf<>(matchers);
@@ -43,6 +45,8 @@ public static <T> AnyOf<T> anyOf(Iterable<Matcher<? super T>> matchers) {
4345
* Creates a matcher that matches if the examined object matches <b>ANY</b> of the specified matchers.
4446
* For example:
4547
* <pre>assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))</pre>
48+
*
49+
* @return The matcher.
4650
*/
4751
@SafeVarargs
4852
public static <T> AnyOf<T> anyOf(Matcher<? super T>... matchers) {

hamcrest/src/main/java/org/hamcrest/core/CombinableMatcher.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ private ArrayList<Matcher<? super T>> templatedListWith(Matcher<? super T> other
4646
* Creates a matcher that matches when both of the specified matchers match the examined object.
4747
* For example:
4848
* <pre>assertThat("fab", both(containsString("a")).and(containsString("b")))</pre>
49+
*
50+
* @return The matcher.
4951
*/
5052
public static <LHS> CombinableBothMatcher<LHS> both(Matcher<? super LHS> matcher) {
5153
return new CombinableBothMatcher<>(matcher);
@@ -65,6 +67,8 @@ public CombinableMatcher<X> and(Matcher<? super X> other) {
6567
* Creates a matcher that matches when either of the specified matchers match the examined object.
6668
* For example:
6769
* <pre>assertThat("fan", either(containsString("a")).or(containsString("b")))</pre>
70+
*
71+
* @return The matcher.
6872
*/
6973
public static <LHS> CombinableEitherMatcher<LHS> either(Matcher<? super LHS> matcher) {
7074
return new CombinableEitherMatcher<>(matcher);

hamcrest/src/main/java/org/hamcrest/core/DescribedAs.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public void describeMismatch(Object item, Description description) {
6262
* the matcher to wrap
6363
* @param values
6464
* optional values to insert into the tokenised description
65+
* @return The matcher.
6566
*/
6667
public static <T> Matcher<T> describedAs(String description, Matcher<T> matcher, Object... values) {
6768
return new DescribedAs<T>(description, matcher, values);

hamcrest/src/main/java/org/hamcrest/core/Every.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public void describeTo(Description description) {
3737
*
3838
* @param itemMatcher
3939
* the matcher to apply to every item provided by the examined {@link Iterable}
40+
* @return The matcher.
4041
*/
4142
public static <U> Matcher<Iterable<? extends U>> everyItem(final Matcher<U> itemMatcher) {
4243
return new Every<>(itemMatcher);

hamcrest/src/main/java/org/hamcrest/core/Is.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ public void describeMismatch(Object item, Description mismatchDescription) {
4242
* <pre>assertThat(cheese, is(equalTo(smelly)))</pre>
4343
* instead of:
4444
* <pre>assertThat(cheese, equalTo(smelly))</pre>
45+
*
46+
* @return The matcher.
4547
*/
4648
public static <T> Matcher<T> is(Matcher<T> matcher) {
4749
return new Is<>(matcher);
@@ -53,6 +55,8 @@ public static <T> Matcher<T> is(Matcher<T> matcher) {
5355
* <pre>assertThat(cheese, is(smelly))</pre>
5456
* instead of:
5557
* <pre>assertThat(cheese, is(equalTo(smelly)))</pre>
58+
*
59+
* @return The matcher.
5660
*/
5761
public static <T> Matcher<T> is(T value) {
5862
return is(equalTo(value));
@@ -64,6 +68,8 @@ public static <T> Matcher<T> is(T value) {
6468
* <pre>assertThat(cheese, isA(Cheddar.class))</pre>
6569
* instead of:
6670
* <pre>assertThat(cheese, is(instanceOf(Cheddar.class)))</pre>
71+
*
72+
* @return The matcher.
6773
*/
6874
public static <T> Matcher<T> isA(Class<?> type) {
6975
return is(IsInstanceOf.<T>instanceOf(type));

hamcrest/src/main/java/org/hamcrest/core/IsAnything.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ public void describeTo(Description description) {
3232

3333
/**
3434
* Creates a matcher that always matches, regardless of the examined object.
35+
*
36+
* @return The matcher.
3537
*/
3638
public static Matcher<Object> anything() { return new IsAnything<>(); }
3739

@@ -41,6 +43,7 @@ public void describeTo(Description description) {
4143
*
4244
* @param description
4345
* a meaningful {@link String} used when describing itself
46+
* @return The matcher.
4447
*/
4548
public static Matcher<Object> anything(String description) {
4649
return new IsAnything<>(description);

hamcrest/src/main/java/org/hamcrest/core/IsCollectionContaining.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public void describeTo(Description description) {
3838
*
3939
* @param itemMatcher
4040
* the matcher to apply to items provided by the examined {@link Iterable}
41+
* @return The matcher.
4142
*/
4243
public static <T> Matcher<Iterable<? super T>> hasItem(Matcher<? super T> itemMatcher) {
4344
return IsIterableContaining.hasItem(itemMatcher);
@@ -55,6 +56,7 @@ public static <T> Matcher<Iterable<? super T>> hasItem(Matcher<? super T> itemMa
5556
*
5657
* @param item
5758
* the item to compare against the items provided by the examined {@link Iterable}
59+
* @return The matcher.
5860
*/
5961
public static <T> Matcher<Iterable<? super T>> hasItem(T item) {
6062
// Doesn't forward to hasItem() method so compiler can sort out generics.
@@ -73,6 +75,7 @@ public static <T> Matcher<Iterable<? super T>> hasItem(T item) {
7375
*
7476
* @param itemMatchers
7577
* the matchers to apply to items provided by the examined {@link Iterable}
78+
* @return The matcher.
7679
*/
7780
@SafeVarargs
7881
public static <T> Matcher<Iterable<T>> hasItems(Matcher<? super T>... itemMatchers) {
@@ -91,6 +94,7 @@ public static <T> Matcher<Iterable<T>> hasItems(Matcher<? super T>... itemMatche
9194
*
9295
* @param items
9396
* the items to compare against the items provided by the examined {@link Iterable}
97+
* @return The matcher.
9498
*/
9599
@SafeVarargs
96100
public static <T> Matcher<Iterable<T>> hasItems(T... items) {

hamcrest/src/main/java/org/hamcrest/core/IsEqual.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ private static boolean isArray(Object o) {
8181
* assertThat("foo", equalTo("foo"));
8282
* assertThat(new String[] {"foo", "bar"}, equalTo(new String[] {"foo", "bar"}));
8383
* </pre>
84+
*
85+
* @return The matcher.
8486
*/
8587
public static <T> Matcher<T> equalTo(T operand) {
8688
return new IsEqual<>(operand);
@@ -89,6 +91,8 @@ public static <T> Matcher<T> equalTo(T operand) {
8991
/**
9092
* Creates an {@link org.hamcrest.core.IsEqual} matcher that does not enforce the values being
9193
* compared to be of the same static type.
94+
*
95+
* @return The matcher.
9296
*/
9397
public static Matcher<Object> equalToObject(Object operand) {
9498
return new IsEqual<>(operand);

hamcrest/src/main/java/org/hamcrest/core/IsInstanceOf.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ public void describeTo(Description description) {
6464
* <p>The created matcher assumes no relationship between specified type and the examined object.</p>
6565
* For example:
6666
* <pre>assertThat(new Canoe(), instanceOf(Paddlable.class));</pre>
67+
*
68+
* @return The matcher.
6769
*/
6870
@SuppressWarnings("unchecked")
6971
public static <T> Matcher<T> instanceOf(Class<?> type) {
@@ -80,6 +82,8 @@ public static <T> Matcher<T> instanceOf(Class<?> type) {
8082
* <code>with(any(Thing.class))</code></p>
8183
* For example:
8284
* <pre>assertThat(new Canoe(), instanceOf(Canoe.class));</pre>
85+
*
86+
* @return The matcher.
8387
*/
8488
@SuppressWarnings("unchecked")
8589
public static <T> Matcher<T> any(Class<T> type) {

0 commit comments

Comments
 (0)