From fce23bf8680eed6272e4807713336f6bddfe5ef4 Mon Sep 17 00:00:00 2001 From: John Patrick <142304+nhojpatrick@users.noreply.github.com> Date: Sun, 13 Feb 2022 15:50:24 +0000 Subject: [PATCH] JavaDoc only @return org.hamcrest --- .../main/java/org/hamcrest/CoreMatchers.java | 58 +++++++ .../main/java/org/hamcrest/Description.java | 12 ++ .../src/main/java/org/hamcrest/Matchers.java | 161 ++++++++++++++++++ .../java/org/hamcrest/StringDescription.java | 3 + .../hamcrest/TypeSafeDiagnosingMatcher.java | 2 + .../java/org/hamcrest/TypeSafeMatcher.java | 2 + 6 files changed, 238 insertions(+) diff --git a/hamcrest/src/main/java/org/hamcrest/CoreMatchers.java b/hamcrest/src/main/java/org/hamcrest/CoreMatchers.java index 6691bab3..4fd8e74e 100644 --- a/hamcrest/src/main/java/org/hamcrest/CoreMatchers.java +++ b/hamcrest/src/main/java/org/hamcrest/CoreMatchers.java @@ -9,6 +9,8 @@ public class CoreMatchers { * Creates a matcher that matches if the examined object matches ALL of the specified matchers. * For example: *
assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
+ * + * @return The matcher. */ public static org.hamcrest.Matcher allOf(java.lang.Iterable> matchers) { return org.hamcrest.core.AllOf.allOf(matchers); @@ -18,6 +20,8 @@ public static org.hamcrest.Matcher allOf(java.lang.IterableALL of the specified matchers. * For example: *
assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
+ * + * @return The matcher. */ @SafeVarargs public static org.hamcrest.Matcher allOf(org.hamcrest.Matcher... matchers) { @@ -29,6 +33,8 @@ public static org.hamcrest.Matcher allOf(org.hamcrest.Matcher. * Creates a matcher that matches if the examined object matches ANY of the specified matchers. * For example: *
assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
+ * + * @return The matcher. */ public static org.hamcrest.core.AnyOf anyOf(java.lang.Iterable> matchers) { return org.hamcrest.core.AnyOf.anyOf(matchers); @@ -38,6 +44,8 @@ public static org.hamcrest.core.AnyOf anyOf(java.lang.IterableANY of the specified matchers. * For example: *
assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
+ * + * @return The matcher. */ @SafeVarargs public static org.hamcrest.core.AnyOf anyOf(org.hamcrest.Matcher... matchers) { @@ -48,6 +56,8 @@ public static org.hamcrest.core.AnyOf anyOf(org.hamcrest.MatcherassertThat("fab", both(containsString("a")).and(containsString("b"))) + * + * @return The matcher. */ public static org.hamcrest.core.CombinableMatcher.CombinableBothMatcher both(org.hamcrest.Matcher matcher) { return org.hamcrest.core.CombinableMatcher.both(matcher); @@ -57,6 +67,8 @@ public static org.hamcrest.core.CombinableMatcher.CombinableBothMatcherassertThat("fan", either(containsString("a")).or(containsString("b"))) + * + * @return The matcher. */ public static org.hamcrest.core.CombinableMatcher.CombinableEitherMatcher either(org.hamcrest.Matcher matcher) { return org.hamcrest.core.CombinableMatcher.either(matcher); @@ -74,6 +86,8 @@ public static org.hamcrest.core.CombinableMatcher.CombinableEitherMatcher< * the matcher to wrap * @param values * optional values to insert into the tokenised description + * + * @return The matcher. */ public static org.hamcrest.Matcher describedAs(java.lang.String description, org.hamcrest.Matcher matcher, java.lang.Object... values) { return org.hamcrest.core.DescribedAs.describedAs(description, matcher, values); @@ -88,6 +102,8 @@ public static org.hamcrest.Matcher describedAs(java.lang.String descripti * * @param itemMatcher * the matcher to apply to every item provided by the examined {@link Iterable} + * + * @return The matcher. */ public static org.hamcrest.Matcher> everyItem(org.hamcrest.Matcher itemMatcher) { return org.hamcrest.core.Every.everyItem(itemMatcher); @@ -100,6 +116,8 @@ public static org.hamcrest.Matcher> everyIte *
assertThat(cheese, is(equalTo(smelly)))
* instead of: *
assertThat(cheese, equalTo(smelly))
+ * + * @return The matcher. */ public static org.hamcrest.Matcher is(org.hamcrest.Matcher matcher) { return org.hamcrest.core.Is.is(matcher); @@ -111,6 +129,8 @@ public static org.hamcrest.Matcher is(org.hamcrest.Matcher matcher) { *
assertThat(cheese, is(smelly))
* instead of: *
assertThat(cheese, is(equalTo(smelly)))
+ * + * @return The matcher. */ public static org.hamcrest.Matcher is(T value) { return org.hamcrest.core.Is.is(value); @@ -122,6 +142,8 @@ public static org.hamcrest.Matcher is(T value) { *
assertThat(cheese, isA(Cheddar.class))
* instead of: *
assertThat(cheese, is(instanceOf(Cheddar.class)))
+ * + * @return The matcher. */ public static org.hamcrest.Matcher isA(java.lang.Class type) { return org.hamcrest.core.Is.isA(type); @@ -129,6 +151,8 @@ public static org.hamcrest.Matcher isA(java.lang.Class type) { /** * Creates a matcher that always matches, regardless of the examined object. + * + * @return The matcher. */ public static org.hamcrest.Matcher anything() { return org.hamcrest.core.IsAnything.anything(); @@ -140,6 +164,8 @@ public static org.hamcrest.Matcher anything() { * * @param description * a meaningful {@link String} used when describing itself + * + * @return The matcher. */ public static org.hamcrest.Matcher anything(java.lang.String description) { return org.hamcrest.core.IsAnything.anything(description); @@ -155,6 +181,8 @@ public static org.hamcrest.Matcher anything(java.lang.String d * * @param itemMatcher * the matcher to apply to items provided by the examined {@link Iterable} + * + * @return The matcher. */ public static org.hamcrest.Matcher> hasItem(org.hamcrest.Matcher itemMatcher) { return IsIterableContaining.hasItem(itemMatcher); @@ -170,6 +198,8 @@ public static org.hamcrest.Matcher> hasItem(or * * @param item * the item to compare against the items provided by the examined {@link Iterable} + * + * @return The matcher. */ public static org.hamcrest.Matcher> hasItem(T item) { return IsIterableContaining.hasItem(item); @@ -185,6 +215,8 @@ public static org.hamcrest.Matcher> hasItem(T * * @param itemMatchers * the matchers to apply to items provided by the examined {@link Iterable} + * + * @return The matcher. */ @SafeVarargs public static org.hamcrest.Matcher> hasItems(org.hamcrest.Matcher... itemMatchers) { @@ -201,6 +233,8 @@ public static org.hamcrest.Matcher> hasItems(org.hamcr * * @param items * the items to compare against the items provided by the examined {@link Iterable} + * + * @return The matcher. */ @SafeVarargs public static org.hamcrest.Matcher> hasItems(T... items) { @@ -227,6 +261,8 @@ public static org.hamcrest.Matcher> hasItems(T... item * assertThat("foo", equalTo("foo")); * assertThat(new String[] {"foo", "bar"}, equalTo(new String[] {"foo", "bar"})); * + * + * @return The matcher. */ public static org.hamcrest.Matcher equalTo(T operand) { return org.hamcrest.core.IsEqual.equalTo(operand); @@ -235,6 +271,8 @@ public static org.hamcrest.Matcher equalTo(T operand) { /** * Creates an {@link org.hamcrest.core.IsEqual} matcher that does not enforce the values being * compared to be of the same static type. + * + * @return The matcher. */ public static org.hamcrest.Matcher equalToObject(java.lang.Object operand) { return org.hamcrest.core.IsEqual.equalToObject(operand); @@ -250,6 +288,8 @@ public static org.hamcrest.Matcher equalToObject(java.lang.Obj * with(any(Thing.class))

* For example: *
assertThat(new Canoe(), any(Canoe.class));
+ * + * @return The matcher. */ public static org.hamcrest.Matcher any(java.lang.Class type) { return org.hamcrest.core.IsInstanceOf.any(type); @@ -263,6 +303,8 @@ public static org.hamcrest.Matcher any(java.lang.Class type) { *

The created matcher assumes no relationship between specified type and the examined object.

* For example: *
assertThat(new Canoe(), instanceOf(Paddlable.class));
+ * + * @return The matcher. */ public static org.hamcrest.Matcher instanceOf(java.lang.Class type) { return org.hamcrest.core.IsInstanceOf.instanceOf(type); @@ -276,6 +318,7 @@ public static org.hamcrest.Matcher instanceOf(java.lang.Class type) { * * @param matcher * the matcher whose sense should be inverted + * @return The matcher. */ public static org.hamcrest.Matcher not(org.hamcrest.Matcher matcher) { return org.hamcrest.core.IsNot.not(matcher); @@ -290,6 +333,7 @@ public static org.hamcrest.Matcher not(org.hamcrest.Matcher matcher) { * * @param value * the value that any examined object should not equal + * @return The matcher. */ public static org.hamcrest.Matcher not(T value) { return org.hamcrest.core.IsNot.not(value); @@ -301,6 +345,8 @@ public static org.hamcrest.Matcher not(T value) { *
assertThat(cheese, is(notNullValue()))
* instead of: *
assertThat(cheese, is(not(nullValue())))
+ * + * @return The matcher. */ public static org.hamcrest.Matcher notNullValue() { return org.hamcrest.core.IsNull.notNullValue(); @@ -316,6 +362,7 @@ public static org.hamcrest.Matcher notNullValue() { * * @param type * dummy parameter used to infer the generic type of the returned matcher + * @return The matcher. */ public static org.hamcrest.Matcher notNullValue(java.lang.Class type) { return org.hamcrest.core.IsNull.notNullValue(type); @@ -325,6 +372,8 @@ public static org.hamcrest.Matcher notNullValue(java.lang.Class type) * Creates a matcher that matches if examined object is null. * For example: *
assertThat(cheese, is(nullValue())
+ * + * @return The matcher. */ public static org.hamcrest.Matcher nullValue() { return org.hamcrest.core.IsNull.nullValue(); @@ -338,6 +387,7 @@ public static org.hamcrest.Matcher nullValue() { * * @param type * dummy parameter used to infer the generic type of the returned matcher + * @return The matcher. */ public static org.hamcrest.Matcher nullValue(java.lang.Class type) { return org.hamcrest.core.IsNull.nullValue(type); @@ -349,6 +399,7 @@ public static org.hamcrest.Matcher nullValue(java.lang.Class type) { * * @param target * the target instance against which others should be assessed + * @return The matcher. */ public static org.hamcrest.Matcher sameInstance(T target) { return org.hamcrest.core.IsSame.sameInstance(target); @@ -360,6 +411,7 @@ public static org.hamcrest.Matcher sameInstance(T target) { * * @param target * the target instance against which others should be assessed + * @return The matcher. */ public static org.hamcrest.Matcher theInstance(T target) { return org.hamcrest.core.IsSame.theInstance(target); @@ -373,6 +425,7 @@ public static org.hamcrest.Matcher theInstance(T target) { * * @param substring * the substring that the returned matcher will expect to find within any examined string + * @return The matcher. */ public static org.hamcrest.Matcher containsString(java.lang.String substring) { return org.hamcrest.core.StringContains.containsString(substring); @@ -386,6 +439,7 @@ public static org.hamcrest.Matcher containsString(java.lang.St * * @param substring * the substring that the returned matcher will expect to find within any examined string + * @return The matcher. */ public static org.hamcrest.Matcher containsStringIgnoringCase(java.lang.String substring) { return org.hamcrest.core.StringContains.containsStringIgnoringCase(substring); @@ -401,6 +455,7 @@ public static org.hamcrest.Matcher containsStringIgnoringCase( * * @param prefix * the substring that the returned matcher will expect at the start of any examined string + * @return The matcher. */ public static org.hamcrest.Matcher startsWith(java.lang.String prefix) { return org.hamcrest.core.StringStartsWith.startsWith(prefix); @@ -416,6 +471,7 @@ public static org.hamcrest.Matcher startsWith(java.lang.String * * @param prefix * the substring that the returned matcher will expect at the start of any examined string + * @return The matcher. */ public static org.hamcrest.Matcher startsWithIgnoringCase(java.lang.String prefix) { return org.hamcrest.core.StringStartsWith.startsWithIgnoringCase(prefix); @@ -429,6 +485,7 @@ public static org.hamcrest.Matcher startsWithIgnoringCase(java * * @param suffix * the substring that the returned matcher will expect at the end of any examined string + * @return The matcher. */ public static org.hamcrest.Matcher endsWith(java.lang.String suffix) { return org.hamcrest.core.StringEndsWith.endsWith(suffix); @@ -442,6 +499,7 @@ public static org.hamcrest.Matcher endsWith(java.lang.String s * * @param suffix * the substring that the returned matcher will expect at the end of any examined string + * @return The matcher. */ public static org.hamcrest.Matcher endsWithIgnoringCase(java.lang.String suffix) { return org.hamcrest.core.StringEndsWith.endsWithIgnoringCase(suffix); diff --git a/hamcrest/src/main/java/org/hamcrest/Description.java b/hamcrest/src/main/java/org/hamcrest/Description.java index 73bfa385..1abfd677 100644 --- a/hamcrest/src/main/java/org/hamcrest/Description.java +++ b/hamcrest/src/main/java/org/hamcrest/Description.java @@ -14,27 +14,37 @@ public interface Description { /** * Appends some plain text to the description. + * + * @return the update description when displaying the matcher error. */ Description appendText(String text); /** * Appends the description of a {@link SelfDescribing} value to this description. + * + * @return the update description when displaying the matcher error. */ Description appendDescriptionOf(SelfDescribing value); /** * Appends an arbitrary value to the description. + * + * @return the update description when displaying the matcher error. */ Description appendValue(Object value); /** * Appends a list of values to the description. + * + * @return the update description when displaying the matcher error. */ Description appendValueList(String start, String separator, String end, T... values); /** * Appends a list of values to the description. + * + * @return the update description when displaying the matcher error. */ Description appendValueList(String start, String separator, String end, Iterable values); @@ -42,6 +52,8 @@ Description appendValueList(String start, String separator, String end, /** * Appends a list of {@link org.hamcrest.SelfDescribing} objects * to the description. + * + * @return the update description when displaying the matcher error. */ Description appendList(String start, String separator, String end, Iterable values); diff --git a/hamcrest/src/main/java/org/hamcrest/Matchers.java b/hamcrest/src/main/java/org/hamcrest/Matchers.java index d4f543ea..3ea72228 100644 --- a/hamcrest/src/main/java/org/hamcrest/Matchers.java +++ b/hamcrest/src/main/java/org/hamcrest/Matchers.java @@ -14,6 +14,8 @@ public class Matchers { * Creates a matcher that matches if the examined object matches ALL of the specified matchers. * For example: *
assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
+ * + * @return The matcher. */ public static org.hamcrest.Matcher allOf(java.lang.Iterable> matchers) { return org.hamcrest.core.AllOf.allOf(matchers); @@ -23,6 +25,8 @@ public static org.hamcrest.Matcher allOf(java.lang.IterableALL of the specified matchers. * For example: *
assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
+ * + * @return The matcher. */ @SafeVarargs public static org.hamcrest.Matcher allOf(org.hamcrest.Matcher... matchers) { @@ -33,6 +37,8 @@ public static org.hamcrest.Matcher allOf(org.hamcrest.Matcher. * Creates a matcher that matches if the examined object matches ALL of the specified matchers. * For example: *
assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
+ * + * @return The matcher. */ public static org.hamcrest.Matcher allOf(org.hamcrest.Matcher first, org.hamcrest.Matcher second) { return org.hamcrest.core.AllOf.allOf(first, second); @@ -42,6 +48,8 @@ public static org.hamcrest.Matcher allOf(org.hamcrest.Matcher * Creates a matcher that matches if the examined object matches ALL of the specified matchers. * For example: *
assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
+ * + * @return The matcher. */ public static org.hamcrest.Matcher allOf(org.hamcrest.Matcher first, org.hamcrest.Matcher second, org.hamcrest.Matcher third) { return org.hamcrest.core.AllOf.allOf(first, second, third); @@ -51,6 +59,8 @@ public static org.hamcrest.Matcher allOf(org.hamcrest.Matcher * Creates a matcher that matches if the examined object matches ALL of the specified matchers. * For example: *
assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
+ * + * @return The matcher. */ public static org.hamcrest.Matcher allOf(org.hamcrest.Matcher first, org.hamcrest.Matcher second, org.hamcrest.Matcher third, org.hamcrest.Matcher fourth) { return org.hamcrest.core.AllOf.allOf(first, second, third, fourth); @@ -60,6 +70,8 @@ public static org.hamcrest.Matcher allOf(org.hamcrest.Matcher * Creates a matcher that matches if the examined object matches ALL of the specified matchers. * For example: *
assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
+ * + * @return The matcher. */ public static org.hamcrest.Matcher allOf(org.hamcrest.Matcher first, org.hamcrest.Matcher second, org.hamcrest.Matcher third, org.hamcrest.Matcher fourth, org.hamcrest.Matcher fifth) { return org.hamcrest.core.AllOf.allOf(first, second, third, fourth, fifth); @@ -69,6 +81,8 @@ public static org.hamcrest.Matcher allOf(org.hamcrest.Matcher * Creates a matcher that matches if the examined object matches ALL of the specified matchers. * For example: *
assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
+ * + * @return The matcher. */ public static org.hamcrest.Matcher allOf(org.hamcrest.Matcher first, org.hamcrest.Matcher second, org.hamcrest.Matcher third, org.hamcrest.Matcher fourth, org.hamcrest.Matcher fifth, org.hamcrest.Matcher sixth) { return org.hamcrest.core.AllOf.allOf(first, second, third, fourth, fifth, sixth); @@ -78,6 +92,8 @@ public static org.hamcrest.Matcher allOf(org.hamcrest.Matcher * Creates a matcher that matches if the examined object matches ANY of the specified matchers. * For example: *
assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
+ * + * @return The matcher. */ public static org.hamcrest.core.AnyOf anyOf(java.lang.Iterable> matchers) { return org.hamcrest.core.AnyOf.anyOf(matchers); @@ -87,6 +103,8 @@ public static org.hamcrest.core.AnyOf anyOf(java.lang.IterableANY of the specified matchers. * For example: *
assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
+ * + * @return The matcher. */ @SafeVarargs public static org.hamcrest.core.AnyOf anyOf(org.hamcrest.Matcher... matchers) { @@ -97,6 +115,8 @@ public static org.hamcrest.core.AnyOf anyOf(org.hamcrest.MatcherANY of the specified matchers. * For example: *
assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
+ * + * @return The matcher. */ public static org.hamcrest.core.AnyOf anyOf(org.hamcrest.Matcher first, org.hamcrest.Matcher second) { return org.hamcrest.core.AnyOf.anyOf(first, second); @@ -106,6 +126,8 @@ public static org.hamcrest.core.AnyOf anyOf(org.hamcrest.MatcherANY of the specified matchers. * For example: *
assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
+ * + * @return The matcher. */ public static org.hamcrest.core.AnyOf anyOf(org.hamcrest.Matcher first, org.hamcrest.Matcher second, org.hamcrest.Matcher third) { return org.hamcrest.core.AnyOf.anyOf(first, second, third); @@ -115,6 +137,8 @@ public static org.hamcrest.core.AnyOf anyOf(org.hamcrest.MatcherANY of the specified matchers. * For example: *
assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
+ * + * @return The matcher. */ public static org.hamcrest.core.AnyOf anyOf(org.hamcrest.Matcher first, org.hamcrest.Matcher second, org.hamcrest.Matcher third, org.hamcrest.Matcher fourth) { return org.hamcrest.core.AnyOf.anyOf(first, second, third, fourth); @@ -124,6 +148,8 @@ public static org.hamcrest.core.AnyOf anyOf(org.hamcrest.MatcherANY of the specified matchers. * For example: *
assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
+ * + * @return The matcher. */ public static org.hamcrest.core.AnyOf anyOf(org.hamcrest.Matcher first, org.hamcrest.Matcher second, org.hamcrest.Matcher third, org.hamcrest.Matcher fourth, org.hamcrest.Matcher fifth) { return org.hamcrest.core.AnyOf.anyOf(first, second, third, fourth, fifth); @@ -133,6 +159,8 @@ public static org.hamcrest.core.AnyOf anyOf(org.hamcrest.MatcherANY of the specified matchers. * For example: *
assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
+ * + * @return The matcher. */ public static org.hamcrest.core.AnyOf anyOf(org.hamcrest.Matcher first, org.hamcrest.Matcher second, org.hamcrest.Matcher third, org.hamcrest.Matcher fourth, org.hamcrest.Matcher fifth, org.hamcrest.Matcher sixth) { return org.hamcrest.core.AnyOf.anyOf(first, second, third, fourth, fifth, sixth); @@ -142,6 +170,8 @@ public static org.hamcrest.core.AnyOf anyOf(org.hamcrest.MatcherassertThat("fab", both(containsString("a")).and(containsString("b"))) + * + * @return The matcher. */ public static org.hamcrest.core.CombinableMatcher.CombinableBothMatcher both(org.hamcrest.Matcher matcher) { return org.hamcrest.core.CombinableMatcher.both(matcher); @@ -151,6 +181,8 @@ public static org.hamcrest.core.CombinableMatcher.CombinableBothMatcherassertThat("fan", either(containsString("a")).or(containsString("b"))) + * + * @return The matcher. */ public static org.hamcrest.core.CombinableMatcher.CombinableEitherMatcher either(org.hamcrest.Matcher matcher) { return org.hamcrest.core.CombinableMatcher.either(matcher); @@ -168,6 +200,7 @@ public static org.hamcrest.core.CombinableMatcher.CombinableEitherMatcher< * the matcher to wrap * @param values * optional values to insert into the tokenized description + * @return The matcher. */ public static org.hamcrest.Matcher describedAs(java.lang.String description, org.hamcrest.Matcher matcher, java.lang.Object... values) { return org.hamcrest.core.DescribedAs.describedAs(description, matcher, values); @@ -182,6 +215,7 @@ public static org.hamcrest.Matcher describedAs(java.lang.String descripti * * @param itemMatcher * the matcher to apply to every item provided by the examined {@link Iterable} + * @return The matcher. */ public static org.hamcrest.Matcher> everyItem(org.hamcrest.Matcher itemMatcher) { return org.hamcrest.core.Every.everyItem(itemMatcher); @@ -194,6 +228,8 @@ public static org.hamcrest.Matcher> everyIte *
assertThat(cheese, is(equalTo(smelly)))
* instead of: *
assertThat(cheese, equalTo(smelly))
+ * + * @return The matcher. */ public static org.hamcrest.Matcher is(org.hamcrest.Matcher matcher) { return org.hamcrest.core.Is.is(matcher); @@ -205,6 +241,8 @@ public static org.hamcrest.Matcher is(org.hamcrest.Matcher matcher) { *
assertThat(cheese, is(smelly))
* instead of: *
assertThat(cheese, is(equalTo(smelly)))
+ * + * @return The matcher. */ public static org.hamcrest.Matcher is(T value) { return org.hamcrest.core.Is.is(value); @@ -216,6 +254,8 @@ public static org.hamcrest.Matcher is(T value) { *
assertThat(cheese, isA(Cheddar.class))
* instead of: *
assertThat(cheese, is(instanceOf(Cheddar.class)))
+ * + * @return The matcher. */ public static org.hamcrest.Matcher isA(java.lang.Class type) { return org.hamcrest.core.Is.isA(type); @@ -223,6 +263,7 @@ public static org.hamcrest.Matcher isA(java.lang.Class type) { /** * Creates a matcher that always matches, regardless of the examined object. + * @return The matcher. */ public static org.hamcrest.Matcher anything() { return org.hamcrest.core.IsAnything.anything(); @@ -234,6 +275,7 @@ public static org.hamcrest.Matcher anything() { * * @param description * a meaningful {@link String} used when describing itself + * @return The matcher. */ public static org.hamcrest.Matcher anything(java.lang.String description) { return org.hamcrest.core.IsAnything.anything(description); @@ -249,6 +291,7 @@ public static org.hamcrest.Matcher anything(java.lang.String d * * @param itemMatcher * the matcher to apply to items provided by the examined {@link Iterable} + * @return The matcher. */ public static org.hamcrest.Matcher> hasItem(org.hamcrest.Matcher itemMatcher) { return IsIterableContaining.hasItem(itemMatcher); @@ -264,6 +307,7 @@ public static org.hamcrest.Matcher> hasItem(or * * @param item * the item to compare against the items provided by the examined {@link Iterable} + * @return The matcher. */ public static org.hamcrest.Matcher> hasItem(T item) { return IsIterableContaining.hasItem(item); @@ -279,6 +323,7 @@ public static org.hamcrest.Matcher> hasItem(T * * @param itemMatchers * the matchers to apply to items provided by the examined {@link Iterable} + * @return The matcher. */ @SafeVarargs public static org.hamcrest.Matcher> hasItems(org.hamcrest.Matcher... itemMatchers) { @@ -295,6 +340,7 @@ public static org.hamcrest.Matcher> hasItems(org.hamcr * * @param items * the items to compare against the items provided by the examined {@link Iterable} + * @return The matcher. */ @SafeVarargs public static org.hamcrest.Matcher> hasItems(T... items) { @@ -321,6 +367,8 @@ public static org.hamcrest.Matcher> hasItems(T... item * assertThat("foo", equalTo("foo")); * assertThat(new String[] {"foo", "bar"}, equalTo(new String[] {"foo", "bar"})); * + * + * @return The matcher. */ public static org.hamcrest.Matcher equalTo(T operand) { return org.hamcrest.core.IsEqual.equalTo(operand); @@ -329,6 +377,8 @@ public static org.hamcrest.Matcher equalTo(T operand) { /** * Creates an {@link org.hamcrest.core.IsEqual} matcher that does not enforce the values being * compared to be of the same static type. + * + * @return The matcher. */ public static org.hamcrest.Matcher equalToObject(java.lang.Object operand) { return org.hamcrest.core.IsEqual.equalToObject(operand); @@ -344,6 +394,8 @@ public static org.hamcrest.Matcher equalToObject(java.lang.Obj * with(any(Thing.class))

* For example: *
assertThat(new Canoe(), instanceOf(Canoe.class));
+ * + * @return The matcher. */ public static org.hamcrest.Matcher any(java.lang.Class type) { return org.hamcrest.core.IsInstanceOf.any(type); @@ -357,6 +409,8 @@ public static org.hamcrest.Matcher any(java.lang.Class type) { *

The created matcher assumes no relationship between specified type and the examined object.

* For example: *
assertThat(new Canoe(), instanceOf(Paddlable.class));
+ * + * @return The matcher. */ public static org.hamcrest.Matcher instanceOf(java.lang.Class type) { return org.hamcrest.core.IsInstanceOf.instanceOf(type); @@ -370,6 +424,7 @@ public static org.hamcrest.Matcher instanceOf(java.lang.Class type) { * * @param matcher * the matcher whose sense should be inverted + * @return The matcher. */ public static org.hamcrest.Matcher not(org.hamcrest.Matcher matcher) { return org.hamcrest.core.IsNot.not(matcher); @@ -384,6 +439,7 @@ public static org.hamcrest.Matcher not(org.hamcrest.Matcher matcher) { * * @param value * the value that any examined object should not equal + * @return The matcher. */ public static org.hamcrest.Matcher not(T value) { return org.hamcrest.core.IsNot.not(value); @@ -395,6 +451,8 @@ public static org.hamcrest.Matcher not(T value) { *
assertThat(cheese, is(notNullValue()))
* instead of: *
assertThat(cheese, is(not(nullValue())))
+ * + * @return The matcher. */ public static org.hamcrest.Matcher notNullValue() { return org.hamcrest.core.IsNull.notNullValue(); @@ -410,6 +468,7 @@ public static org.hamcrest.Matcher notNullValue() { * * @param type * dummy parameter used to infer the generic type of the returned matcher + * @return The matcher. */ public static org.hamcrest.Matcher notNullValue(java.lang.Class type) { return org.hamcrest.core.IsNull.notNullValue(type); @@ -419,6 +478,8 @@ public static org.hamcrest.Matcher notNullValue(java.lang.Class type) * Creates a matcher that matches if examined object is null. * For example: *
assertThat(cheese, is(nullValue())
+ * + * @return The matcher. */ public static org.hamcrest.Matcher nullValue() { return org.hamcrest.core.IsNull.nullValue(); @@ -432,6 +493,7 @@ public static org.hamcrest.Matcher nullValue() { * * @param type * dummy parameter used to infer the generic type of the returned matcher + * @return The matcher. */ public static org.hamcrest.Matcher nullValue(java.lang.Class type) { return org.hamcrest.core.IsNull.nullValue(type); @@ -443,6 +505,7 @@ public static org.hamcrest.Matcher nullValue(java.lang.Class type) { * * @param target * the target instance against which others should be assessed + * @return The matcher. */ public static org.hamcrest.Matcher sameInstance(T target) { return org.hamcrest.core.IsSame.sameInstance(target); @@ -454,6 +517,7 @@ public static org.hamcrest.Matcher sameInstance(T target) { * * @param target * the target instance against which others should be assessed + * @return The matcher. */ public static org.hamcrest.Matcher theInstance(T target) { return org.hamcrest.core.IsSame.theInstance(target); @@ -467,6 +531,7 @@ public static org.hamcrest.Matcher theInstance(T target) { * * @param substring * the substring that the returned matcher will expect to find within any examined string + * @return The matcher. */ public static Matcher containsString(java.lang.String substring) { return org.hamcrest.core.StringContains.containsString(substring); @@ -480,6 +545,7 @@ public static Matcher containsString(java.lang.String substrin * * @param substring * the substring that the returned matcher will expect to find within any examined string + * @return The matcher. */ public static Matcher containsStringIgnoringCase(java.lang.String substring) { return org.hamcrest.core.StringContains.containsStringIgnoringCase(substring); @@ -495,6 +561,7 @@ public static Matcher containsStringIgnoringCase(java.lang.Str * * @param prefix * the substring that the returned matcher will expect at the start of any examined string + * @return The matcher. */ public static Matcher startsWith(java.lang.String prefix) { return org.hamcrest.core.StringStartsWith.startsWith(prefix); @@ -510,6 +577,7 @@ public static Matcher startsWith(java.lang.String prefix) { * * @param prefix * the substring that the returned matcher will expect at the start of any examined string + * @return The matcher. */ public static Matcher startsWithIgnoringCase(java.lang.String prefix) { return org.hamcrest.core.StringStartsWith.startsWithIgnoringCase(prefix); @@ -523,6 +591,7 @@ public static Matcher startsWithIgnoringCase(java.lang.String * * @param suffix * the substring that the returned matcher will expect at the end of any examined string + * @return The matcher. */ public static Matcher endsWith(java.lang.String suffix) { return org.hamcrest.core.StringEndsWith.endsWith(suffix); @@ -536,6 +605,7 @@ public static Matcher endsWith(java.lang.String suffix) { * * @param suffix * the substring that the returned matcher will expect at the end of any examined string + * @return The matcher. */ public static Matcher endsWithIgnoringCase(java.lang.String suffix) { return org.hamcrest.core.StringEndsWith.endsWithIgnoringCase(suffix); @@ -580,6 +650,7 @@ public static Matcher matchesRegex(String regex) { * * @param elementMatchers * the matchers that the elements of examined arrays should satisfy + * @return The matcher. */ @SafeVarargs public static org.hamcrest.collection.IsArray array(org.hamcrest.Matcher... elementMatchers) { @@ -595,6 +666,7 @@ public static org.hamcrest.collection.IsArray array(org.hamcrest.Matcher< * * @param elementMatcher * the matcher to apply to elements in examined arrays + * @return The matcher. */ public static org.hamcrest.Matcher hasItemInArray(org.hamcrest.Matcher elementMatcher) { return ArrayMatching.hasItemInArray(elementMatcher); @@ -609,6 +681,7 @@ public static org.hamcrest.Matcher hasItemInArray(org.hamcrest.Matcher< * * @param element * the element that should be present in examined arrays + * @return The matcher. */ public static org.hamcrest.Matcher hasItemInArray(T element) { return ArrayMatching.hasItemInArray(element); @@ -623,6 +696,7 @@ public static org.hamcrest.Matcher hasItemInArray(T element) { * * @param items * the items that must equal the items within an examined array + * @return The matcher. */ @SafeVarargs public static org.hamcrest.Matcher arrayContaining(E... items) { @@ -638,6 +712,7 @@ public static org.hamcrest.Matcher arrayContaining(E... items) { * * @param itemMatchers * the matchers that must be satisfied by the items in the examined array + * @return The matcher. */ @SafeVarargs public static org.hamcrest.Matcher arrayContaining(org.hamcrest.Matcher... itemMatchers) { @@ -653,6 +728,7 @@ public static org.hamcrest.Matcher arrayContaining(org.hamcrest.Matcher * * @param itemMatchers * a list of matchers, each of which must be satisfied by the corresponding item in an examined array + * @return The matcher. */ public static org.hamcrest.Matcher arrayContaining(java.util.List> itemMatchers) { return ArrayMatching.arrayContaining(itemMatchers); @@ -677,6 +753,7 @@ public static org.hamcrest.Matcher arrayContaining(java.util.List org.hamcrest.Matcher arrayContainingInAnyOrder(org.hamcrest.Matcher... itemMatchers) { @@ -702,6 +779,7 @@ public static org.hamcrest.Matcher arrayContainingInAnyOrder(org.hamcre * * @param itemMatchers * a list of matchers, each of which must be satisfied by an item provided by an examined array + * @return The matcher. */ public static org.hamcrest.Matcher arrayContainingInAnyOrder(java.util.Collection> itemMatchers) { return ArrayMatching.arrayContainingInAnyOrder(itemMatchers); @@ -724,6 +802,7 @@ public static org.hamcrest.Matcher arrayContainingInAnyOrder(java.util. * * @param items * the items that must equal the entries of an examined array, in any order + * @return The matcher. */ @SafeVarargs public static org.hamcrest.Matcher arrayContainingInAnyOrder(E... items) { @@ -738,6 +817,7 @@ public static org.hamcrest.Matcher arrayContainingInAnyOrder(E... items * * @param sizeMatcher * a matcher for the length of an examined array + * @return The matcher. */ public static org.hamcrest.Matcher arrayWithSize(org.hamcrest.Matcher sizeMatcher) { return org.hamcrest.collection.IsArrayWithSize.arrayWithSize(sizeMatcher); @@ -751,6 +831,7 @@ public static org.hamcrest.Matcher arrayWithSize(org.hamcrest.Matcher org.hamcrest.Matcher arrayWithSize(int size) { return org.hamcrest.collection.IsArrayWithSize.arrayWithSize(size); @@ -761,6 +842,8 @@ public static org.hamcrest.Matcher arrayWithSize(int size) { * is zero. * For example: *
assertThat(new String[0], emptyArray())
+ * + * @return The matcher. */ public static org.hamcrest.Matcher emptyArray() { return org.hamcrest.collection.IsArrayWithSize.emptyArray(); @@ -774,6 +857,7 @@ public static org.hamcrest.Matcher emptyArray() { * * @param sizeMatcher * a matcher for the size of an examined {@link java.util.Map} + * @return The matcher. */ public static org.hamcrest.Matcher> aMapWithSize(org.hamcrest.Matcher sizeMatcher) { return org.hamcrest.collection.IsMapWithSize.aMapWithSize(sizeMatcher); @@ -787,6 +871,7 @@ public static org.hamcrest.Matcher * * @param size * the expected size of an examined {@link java.util.Map} + * @return The matcher. */ public static org.hamcrest.Matcher> aMapWithSize(int size) { return org.hamcrest.collection.IsMapWithSize.aMapWithSize(size); @@ -797,6 +882,8 @@ public static org.hamcrest.Matcher * zero. * For example: *
assertThat(myMap, is(anEmptyMap()))
+ * + * @return The matcher. */ public static org.hamcrest.Matcher> anEmptyMap() { return org.hamcrest.collection.IsMapWithSize.anEmptyMap(); @@ -810,6 +897,7 @@ public static org.hamcrest.Matcher * * @param sizeMatcher * a matcher for the size of an examined {@link java.util.Collection} + * @return The matcher. */ public static org.hamcrest.Matcher> hasSize(org.hamcrest.Matcher sizeMatcher) { return org.hamcrest.collection.IsCollectionWithSize.hasSize(sizeMatcher); @@ -823,6 +911,7 @@ public static org.hamcrest.Matcher> hasSiz * * @param size * the expected size of an examined {@link java.util.Collection} + * @return The matcher. */ public static org.hamcrest.Matcher> hasSize(int size) { return org.hamcrest.collection.IsCollectionWithSize.hasSize(size); @@ -833,6 +922,8 @@ public static org.hamcrest.Matcher> hasSiz * method returns true. * For example: *
assertThat(new ArrayList<String>(), is(empty()))
+ * + * @return The matcher. */ public static org.hamcrest.Matcher> empty() { return org.hamcrest.collection.IsEmptyCollection.empty(); @@ -846,6 +937,7 @@ public static org.hamcrest.Matcher> empty( * * @param unusedToForceReturnType * the type of the collection's content + * @return The matcher. */ public static org.hamcrest.Matcher> emptyCollectionOf(java.lang.Class unusedToForceReturnType) { return org.hamcrest.collection.IsEmptyCollection.emptyCollectionOf(unusedToForceReturnType); @@ -855,6 +947,8 @@ public static org.hamcrest.Matcher> emptyCollectionO * Creates a matcher for {@link Iterable}s matching examined iterables that yield no items. * For example: *
assertThat(new ArrayList<String>(), is(emptyIterable()))
+ * + * @return The matcher. */ public static org.hamcrest.Matcher> emptyIterable() { return org.hamcrest.collection.IsEmptyIterable.emptyIterable(); @@ -867,6 +961,7 @@ public static org.hamcrest.Matcher> emptyIte * * @param unusedToForceReturnType * the type of the iterable's content + * @return The matcher. */ public static org.hamcrest.Matcher> emptyIterableOf(java.lang.Class unusedToForceReturnType) { return org.hamcrest.collection.IsEmptyIterable.emptyIterableOf(unusedToForceReturnType); @@ -882,6 +977,7 @@ public static org.hamcrest.Matcher> emptyIterableOf(ja * * @param items * the items that must equal the items provided by an examined {@link Iterable} + * @return The matcher. */ @SafeVarargs public static org.hamcrest.Matcher> contains(E... items) { @@ -898,6 +994,7 @@ public static org.hamcrest.Matcher> contains * @param itemMatcher * the matcher that must be satisfied by the single item provided by an * examined {@link Iterable} + * @return The matcher. */ public static org.hamcrest.Matcher> contains(org.hamcrest.Matcher itemMatcher) { return org.hamcrest.collection.IsIterableContainingInOrder.contains(itemMatcher); @@ -913,6 +1010,7 @@ public static org.hamcrest.Matcher> contains * * @param itemMatchers * the matchers that must be satisfied by the items provided by an examined {@link Iterable} + * @return The matcher. */ @SafeVarargs public static org.hamcrest.Matcher> contains(org.hamcrest.Matcher... itemMatchers) { @@ -930,6 +1028,7 @@ public static org.hamcrest.Matcher> contains * @param itemMatchers * a list of matchers, each of which must be satisfied by the corresponding item provided by * an examined {@link Iterable} + * @return The matcher. */ public static org.hamcrest.Matcher> contains(java.util.List> itemMatchers) { return org.hamcrest.collection.IsIterableContainingInOrder.contains(itemMatchers); @@ -954,6 +1053,7 @@ public static org.hamcrest.Matcher> contains * * @param itemMatchers * a list of matchers, each of which must be satisfied by an item provided by an examined {@link Iterable} + * @return The matcher. */ @SafeVarargs public static org.hamcrest.Matcher> containsInAnyOrder(org.hamcrest.Matcher... itemMatchers) { @@ -979,6 +1079,7 @@ public static org.hamcrest.Matcher> contains * * @param items * the items that must equal the items provided by an examined {@link Iterable} in any order + * @return The matcher. */ @SafeVarargs public static org.hamcrest.Matcher> containsInAnyOrder(T... items) { @@ -1002,6 +1103,7 @@ public static org.hamcrest.Matcher> contains * * @param itemMatchers * a list of matchers, each of which must be satisfied by an item provided by an examined {@link Iterable} + * @return The matcher. */ public static org.hamcrest.Matcher> containsInAnyOrder(java.util.Collection> itemMatchers) { return org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder(itemMatchers); @@ -1016,6 +1118,7 @@ public static org.hamcrest.Matcher> contains * * @param items * the items that must be contained within items provided by an examined {@link Iterable} in the same relative order + * @return The matcher. */ @SafeVarargs public static org.hamcrest.Matcher> containsInRelativeOrder(E... items) { @@ -1031,6 +1134,7 @@ public static org.hamcrest.Matcher> contains * * @param itemMatchers * the matchers that must be satisfied by the items provided by an examined {@link Iterable} in the same relative order + * @return The matcher. */ @SafeVarargs public static org.hamcrest.Matcher> containsInRelativeOrder(org.hamcrest.Matcher... itemMatchers) { @@ -1047,6 +1151,7 @@ public static org.hamcrest.Matcher> contains * @param itemMatchers * a list of matchers, each of which must be satisfied by the items provided by * an examined {@link Iterable} in the same relative order + * @return The matcher. */ public static org.hamcrest.Matcher> containsInRelativeOrder(java.util.List> itemMatchers) { return org.hamcrest.collection.IsIterableContainingInRelativeOrder.containsInRelativeOrder(itemMatchers); @@ -1061,6 +1166,7 @@ public static org.hamcrest.Matcher> contains * * @param sizeMatcher * a matcher for the number of items that should be yielded by an examined {@link Iterable} + * @return The matcher. */ public static org.hamcrest.Matcher> iterableWithSize(org.hamcrest.Matcher sizeMatcher) { return org.hamcrest.collection.IsIterableWithSize.iterableWithSize(sizeMatcher); @@ -1075,6 +1181,7 @@ public static org.hamcrest.Matcher> iterableWithSize(o * * @param size * the number of items that should be yielded by an examined {@link Iterable} + * @return The matcher. */ public static org.hamcrest.Matcher> iterableWithSize(int size) { return org.hamcrest.collection.IsIterableWithSize.iterableWithSize(size); @@ -1091,6 +1198,7 @@ public static org.hamcrest.Matcher> iterableWithSize(i * the key matcher that, in combination with the valueMatcher, must be satisfied by at least one entry * @param valueMatcher * the value matcher that, in combination with the keyMatcher, must be satisfied by at least one entry + * @return The matcher. */ public static org.hamcrest.Matcher> hasEntry(org.hamcrest.Matcher keyMatcher, org.hamcrest.Matcher valueMatcher) { return org.hamcrest.collection.IsMapContaining.hasEntry(keyMatcher, valueMatcher); @@ -1107,6 +1215,7 @@ public static org.hamcrest.Matcher * the key that, in combination with the value, must be describe at least one entry * @param value * the value that, in combination with the key, must be describe at least one entry + * @return The matcher. */ public static org.hamcrest.Matcher> hasEntry(K key, V value) { return org.hamcrest.collection.IsMapContaining.hasEntry(key, value); @@ -1120,6 +1229,7 @@ public static org.hamcrest.Matcher * * @param keyMatcher * the matcher that must be satisfied by at least one key + * @return The matcher. */ public static org.hamcrest.Matcher> hasKey(org.hamcrest.Matcher keyMatcher) { return org.hamcrest.collection.IsMapContaining.hasKey(keyMatcher); @@ -1133,6 +1243,7 @@ public static org.hamcrest.Matcher> hasKey(org. * * @param key * the key that satisfying maps must contain + * @return The matcher. */ public static org.hamcrest.Matcher> hasKey(K key) { return org.hamcrest.collection.IsMapContaining.hasKey(key); @@ -1146,6 +1257,7 @@ public static org.hamcrest.Matcher> hasKey(K ke * * @param valueMatcher * the matcher that must be satisfied by at least one value + * @return The matcher. */ public static org.hamcrest.Matcher> hasValue(org.hamcrest.Matcher valueMatcher) { return org.hamcrest.collection.IsMapContaining.hasValue(valueMatcher); @@ -1159,6 +1271,7 @@ public static org.hamcrest.Matcher> hasValue(or * * @param value * the value that satisfying maps must contain + * @return The matcher. */ public static org.hamcrest.Matcher> hasValue(V value) { return org.hamcrest.collection.IsMapContaining.hasValue(value); @@ -1172,6 +1285,7 @@ public static org.hamcrest.Matcher> hasValue(V * * @param collection * the collection in which matching items must be found + * @return The matcher. */ public static org.hamcrest.Matcher in(java.util.Collection collection) { return org.hamcrest.collection.IsIn.in(collection); @@ -1185,6 +1299,7 @@ public static org.hamcrest.Matcher in(java.util.Collection collection) * * @param elements * the array in which matching items must be found + * @return The matcher. */ public static org.hamcrest.Matcher in(T[] elements) { return org.hamcrest.collection.IsIn.in(elements); @@ -1199,6 +1314,7 @@ public static org.hamcrest.Matcher in(T[] elements) { * @deprecated use is(in(...)) instead * @param collection * the collection in which matching items must be found + * @return The matcher. */ @SuppressWarnings("deprecation") public static org.hamcrest.Matcher isIn(java.util.Collection collection) { @@ -1214,6 +1330,7 @@ public static org.hamcrest.Matcher isIn(java.util.Collection collectio * @deprecated use is(in(...)) instead * @param elements * the array in which matching items must be found + * @return The matcher. */ @SuppressWarnings("deprecation") public static org.hamcrest.Matcher isIn(T[] elements) { @@ -1229,6 +1346,7 @@ public static org.hamcrest.Matcher isIn(T[] elements) { * @deprecated use is(oneOf(...)) instead * @param elements * the elements amongst which matching items will be found + * @return The matcher. */ @SuppressWarnings("deprecation") @SafeVarargs @@ -1244,6 +1362,7 @@ public static org.hamcrest.Matcher isOneOf(T... elements) { * * @param elements * the elements amongst which matching items will be found + * @return The matcher. */ @SafeVarargs public static org.hamcrest.Matcher oneOf(T... elements) { @@ -1260,6 +1379,7 @@ public static org.hamcrest.Matcher oneOf(T... elements) { * the expected value of matching doubles * @param error * the delta (+/-) within which matches will be allowed + * @return The matcher. */ public static org.hamcrest.Matcher closeTo(double operand, double error) { return org.hamcrest.number.IsCloseTo.closeTo(operand, error); @@ -1269,6 +1389,8 @@ public static org.hamcrest.Matcher closeTo(double operand, dou * Creates a matcher of {@link Double}s that matches when an examined double is not a number. * For example: *
assertThat(Double.NaN, is(notANumber()))
+ * + * @return The matcher. */ public static org.hamcrest.Matcher notANumber() { return org.hamcrest.number.IsNaN.notANumber(); @@ -1285,6 +1407,7 @@ public static org.hamcrest.Matcher notANumber() { * the expected value of matching BigDecimals * @param error * the delta (+/-) within which matches will be allowed + * @return The matcher. */ public static org.hamcrest.Matcher closeTo(java.math.BigDecimal operand, java.math.BigDecimal error) { return org.hamcrest.number.BigDecimalCloseTo.closeTo(operand, error); @@ -1298,6 +1421,7 @@ public static org.hamcrest.Matcher closeTo(java.math.BigDe *
assertThat(1, comparesEqualTo(1))
* * @param value the value which, when passed to the compareTo method of the examined object, should return zero + * @return The matcher. */ public static > org.hamcrest.Matcher comparesEqualTo(T value) { return org.hamcrest.number.OrderingComparison.comparesEqualTo(value); @@ -1312,6 +1436,7 @@ public static > org.hamcrest.Matcher compar * * @param value the value which, when passed to the compareTo method of the examined object, should return greater * than zero + * @return The matcher. */ public static > org.hamcrest.Matcher greaterThan(T value) { return org.hamcrest.number.OrderingComparison.greaterThan(value); @@ -1326,6 +1451,7 @@ public static > org.hamcrest.Matcher greate * * @param value the value which, when passed to the compareTo method of the examined object, should return greater * than or equal to zero + * @return The matcher. */ public static > org.hamcrest.Matcher greaterThanOrEqualTo(T value) { return org.hamcrest.number.OrderingComparison.greaterThanOrEqualTo(value); @@ -1340,6 +1466,7 @@ public static > org.hamcrest.Matcher greate * * @param value the value which, when passed to the compareTo method of the examined object, should return less * than zero + * @return The matcher. */ public static > org.hamcrest.Matcher lessThan(T value) { return org.hamcrest.number.OrderingComparison.lessThan(value); @@ -1354,6 +1481,7 @@ public static > org.hamcrest.Matcher lessTh * * @param value the value which, when passed to the compareTo method of the examined object, should return less * than or equal to zero + * @return The matcher. */ public static > org.hamcrest.Matcher lessThanOrEqualTo(T value) { return org.hamcrest.number.OrderingComparison.lessThanOrEqualTo(value); @@ -1367,6 +1495,7 @@ public static > org.hamcrest.Matcher lessTh * * @param expectedString * the expected value of matched strings + * @return The matcher. */ public static Matcher equalToIgnoringCase(java.lang.String expectedString) { return org.hamcrest.text.IsEqualIgnoringCase.equalToIgnoringCase(expectedString); @@ -1376,6 +1505,7 @@ public static Matcher equalToIgnoringCase(java.lang.String exp * @deprecated {@link #equalToCompressingWhiteSpace(String)} * @param expectedString * the expected value of matched strings + * @return The matcher. */ public static Matcher equalToIgnoringWhiteSpace(java.lang.String expectedString) { return equalToCompressingWhiteSpace(expectedString); @@ -1394,6 +1524,7 @@ public static Matcher equalToIgnoringWhiteSpace(java.lang.Stri * * @param expectedString * the expected value of matched strings + * @return The matcher. */ public static Matcher equalToCompressingWhiteSpace(java.lang.String expectedString) { return IsEqualCompressingWhiteSpace.equalToCompressingWhiteSpace(expectedString); @@ -1404,6 +1535,8 @@ public static Matcher equalToCompressingWhiteSpace(java.lang.S * has zero length. * For example: *
assertThat(((String)null), is(emptyOrNullString()))
+ * + * @return The matcher. */ public static Matcher emptyOrNullString() { return org.hamcrest.text.IsEmptyString.emptyOrNullString(); @@ -1413,6 +1546,8 @@ public static Matcher emptyOrNullString() { * Creates a matcher of {@link String} that matches when the examined string has zero length. * For example: *
assertThat("", is(emptyString()))
+ * + * @return The matcher. */ public static Matcher emptyString() { return org.hamcrest.text.IsEmptyString.emptyString(); @@ -1425,6 +1560,7 @@ public static Matcher emptyString() { *
assertThat(((String)null), isEmptyOrNullString())
* * @deprecated use is(emptyOrNullString()) instead + * @return The matcher. */ @SuppressWarnings("deprecation") public static Matcher isEmptyOrNullString() { @@ -1437,6 +1573,7 @@ public static Matcher isEmptyOrNullString() { *
assertThat("", isEmptyString())
* * @deprecated use is(emptyString()) instead + * @return The matcher. */ @SuppressWarnings("deprecation") public static Matcher isEmptyString() { @@ -1448,6 +1585,8 @@ public static Matcher isEmptyString() { * contains zero or more whitespace characters and nothing else. * For example: *
assertThat(((String)null), is(blankOrNullString()))
+ * + * @return The matcher. */ public static Matcher blankOrNullString() { return org.hamcrest.text.IsBlankString.blankOrNullString(); @@ -1458,6 +1597,8 @@ public static Matcher blankOrNullString() { * zero or more whitespace characters and nothing else. * For example: *
assertThat("  ", is(blankString()))
+ * + * @return The matcher. */ public static Matcher blankString() { return org.hamcrest.text.IsBlankString.blankString(); @@ -1466,6 +1607,8 @@ public static Matcher blankString() { /** * Creates a matcher of {@link java.lang.String} that matches when the examined string * exactly matches the given {@link java.util.regex.Pattern}. + * + * @return The matcher. */ public static Matcher matchesPattern(java.util.regex.Pattern pattern) { return org.hamcrest.text.MatchesPattern.matchesPattern(pattern); @@ -1474,6 +1617,8 @@ public static Matcher matchesPattern(java.util.regex.Pattern p /** * Creates a matcher of {@link java.lang.String} that matches when the examined string * exactly matches the given regular expression, treated as a {@link java.util.regex.Pattern}. + * + * @return The matcher. */ public static Matcher matchesPattern(java.lang.String regex) { return org.hamcrest.text.MatchesPattern.matchesPattern(regex); @@ -1488,6 +1633,7 @@ public static Matcher matchesPattern(java.lang.String regex) { * * @param substrings * the substrings that must be contained within matching strings + * @return The matcher. */ public static Matcher stringContainsInOrder(java.lang.Iterable substrings) { return org.hamcrest.text.StringContainsInOrder.stringContainsInOrder(substrings); @@ -1502,6 +1648,7 @@ public static Matcher stringContainsInOrder(java.lang.Iterable * * @param substrings * the substrings that must be contained within matching strings + * @return The matcher. */ public static Matcher stringContainsInOrder(java.lang.String... substrings) { return org.hamcrest.text.StringContainsInOrder.stringContainsInOrder(substrings); @@ -1517,6 +1664,7 @@ public static Matcher stringContainsInOrder(java.lang.String.. * * * @param lengthMatcher a matcher for the expected length of the string + * @return The matcher. */ public static Matcher hasLength(org.hamcrest.Matcher lengthMatcher) { return org.hamcrest.text.CharSequenceLength.hasLength(lengthMatcher); @@ -1532,6 +1680,7 @@ public static Matcher hasLength(org.hamcrest.Matcher * * @param length the expected length of the string + * @return The matcher. */ public static Matcher hasLength(int length) { return org.hamcrest.text.CharSequenceLength.hasLength(length); @@ -1545,6 +1694,7 @@ public static Matcher hasLength(int length) { * * @param toStringMatcher * the matcher used to verify the toString result + * @return The matcher. */ public static org.hamcrest.Matcher hasToString(org.hamcrest.Matcher toStringMatcher) { return org.hamcrest.object.HasToString.hasToString(toStringMatcher); @@ -1558,6 +1708,7 @@ public static org.hamcrest.Matcher hasToString(org.hamcrest.Matcher org.hamcrest.Matcher hasToString(java.lang.String expectedToString) { return org.hamcrest.object.HasToString.hasToString(expectedToString); @@ -1571,6 +1722,7 @@ public static org.hamcrest.Matcher hasToString(java.lang.String expectedT * * @param baseType * the base class to examine classes against + * @return The matcher. */ public static org.hamcrest.Matcher> typeCompatibleWith(java.lang.Class baseType) { return org.hamcrest.object.IsCompatibleType.typeCompatibleWith(baseType); @@ -1586,6 +1738,7 @@ public static org.hamcrest.Matcher> typeCompatibleWith(ja * the class of the event to match on * @param source * the source of the event + * @return The matcher. */ public static org.hamcrest.Matcher eventFrom(java.lang.Class eventClass, java.lang.Object source) { return org.hamcrest.object.IsEventFrom.eventFrom(eventClass, source); @@ -1599,6 +1752,7 @@ public static org.hamcrest.Matcher eventFrom(java.lang.Cl * * @param source * the source of the event + * @return The matcher. */ public static org.hamcrest.Matcher eventFrom(java.lang.Object source) { return org.hamcrest.object.IsEventFrom.eventFrom(source); @@ -1612,6 +1766,7 @@ public static org.hamcrest.Matcher eventFrom(java.lang.Ob * * @param propertyName * the name of the JavaBean property that examined beans should possess + * @return The matcher. */ public static org.hamcrest.Matcher hasProperty(java.lang.String propertyName) { return org.hamcrest.beans.HasProperty.hasProperty(propertyName); @@ -1627,6 +1782,7 @@ public static org.hamcrest.Matcher hasProperty(java.lang.String propertyN * the name of the JavaBean property that examined beans should possess * @param valueMatcher * a matcher for the value of the specified property of the examined bean + * @return The matcher. */ public static org.hamcrest.Matcher hasProperty(java.lang.String propertyName, org.hamcrest.Matcher valueMatcher) { return org.hamcrest.beans.HasPropertyWithValue.hasProperty(propertyName, valueMatcher); @@ -1646,6 +1802,7 @@ public static org.hamcrest.Matcher hasProperty(java.lang.String propertyN * the bean against which examined beans are compared * @param ignoredProperties * do not check any of these named properties. + * @return The matcher. */ public static Matcher samePropertyValuesAs(B expectedBean, String... ignoredProperties) { return org.hamcrest.beans.SamePropertyValuesAs.samePropertyValuesAs(expectedBean, ignoredProperties); @@ -1661,6 +1818,7 @@ public static Matcher samePropertyValuesAs(B expectedBean, String... igno * the target xpath * @param valueMatcher * matcher for the value at the specified xpath + * @return The matcher. */ public static org.hamcrest.Matcher hasXPath(java.lang.String xPath, Matcher valueMatcher) { return org.hamcrest.xml.HasXPath.hasXPath(xPath, valueMatcher); @@ -1679,6 +1837,7 @@ public static org.hamcrest.Matcher hasXPath(java.lang.String x * the namespace for matching nodes * @param valueMatcher * matcher for the value at the specified xpath + * @return The matcher. */ public static org.hamcrest.Matcher hasXPath(java.lang.String xPath, javax.xml.namespace.NamespaceContext namespaceContext, Matcher valueMatcher) { return org.hamcrest.xml.HasXPath.hasXPath(xPath, namespaceContext, valueMatcher); @@ -1692,6 +1851,7 @@ public static org.hamcrest.Matcher hasXPath(java.lang.String x * * @param xPath * the target xpath + * @return The matcher. */ public static org.hamcrest.Matcher hasXPath(java.lang.String xPath) { return org.hamcrest.xml.HasXPath.hasXPath(xPath); @@ -1707,6 +1867,7 @@ public static org.hamcrest.Matcher hasXPath(java.lang.String x * the target xpath * @param namespaceContext * the namespace for matching nodes + * @return The matcher. */ public static org.hamcrest.Matcher hasXPath(java.lang.String xPath, javax.xml.namespace.NamespaceContext namespaceContext) { return org.hamcrest.xml.HasXPath.hasXPath(xPath, namespaceContext); diff --git a/hamcrest/src/main/java/org/hamcrest/StringDescription.java b/hamcrest/src/main/java/org/hamcrest/StringDescription.java index 7aac98d1..c902f80f 100644 --- a/hamcrest/src/main/java/org/hamcrest/StringDescription.java +++ b/hamcrest/src/main/java/org/hamcrest/StringDescription.java @@ -30,6 +30,9 @@ public static String toString(SelfDescribing selfDescribing) { /** * Alias for {@link #toString(SelfDescribing)}. + * + * @return + * The description of the object. */ public static String asString(SelfDescribing selfDescribing) { return toString(selfDescribing); diff --git a/hamcrest/src/main/java/org/hamcrest/TypeSafeDiagnosingMatcher.java b/hamcrest/src/main/java/org/hamcrest/TypeSafeDiagnosingMatcher.java index 03efa9db..b13c1d4b 100644 --- a/hamcrest/src/main/java/org/hamcrest/TypeSafeDiagnosingMatcher.java +++ b/hamcrest/src/main/java/org/hamcrest/TypeSafeDiagnosingMatcher.java @@ -21,6 +21,8 @@ public abstract class TypeSafeDiagnosingMatcher extends BaseMatcher { /** * Subclasses should implement this. The item will already have been checked * for the specific type and will never be null. + * + * @return boolean true/false depending if item matches matcher. */ protected abstract boolean matchesSafely(T item, Description mismatchDescription); diff --git a/hamcrest/src/main/java/org/hamcrest/TypeSafeMatcher.java b/hamcrest/src/main/java/org/hamcrest/TypeSafeMatcher.java index 08dfce8b..ed7b08e3 100644 --- a/hamcrest/src/main/java/org/hamcrest/TypeSafeMatcher.java +++ b/hamcrest/src/main/java/org/hamcrest/TypeSafeMatcher.java @@ -43,6 +43,8 @@ protected TypeSafeMatcher(ReflectiveTypeFinder typeFinder) { /** * Subclasses should implement this. The item will already have been checked for * the specific type and will never be null. + * + * @return boolean true/false depending if item matches matcher. */ protected abstract boolean matchesSafely(T item);