Skip to content

Commit 0ff87f9

Browse files
committed
JavaDoc only @return
1 parent a82f91f commit 0ff87f9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+165
-2
lines changed

hamcrest-integration/src/main/java/org/hamcrest/integration/EasyMock2Adapter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ public class EasyMock2Adapter implements IArgumentMatcher {
1818
* Hamcrest {@link org.hamcrest.Matcher} to act as an
1919
* EasyMock {@link org.easymock.IArgumentMatcher} and
2020
* report it to EasyMock so it can be kept track of.
21+
*
22+
* @return The EasyMock matcher.
2123
*/
2224
public static IArgumentMatcher adapt(Matcher<?> matcher) {
2325
EasyMock2Adapter easyMock2Matcher = new EasyMock2Adapter(matcher);

hamcrest-integration/src/main/java/org/hamcrest/integration/JMock1Adapter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ public class JMock1Adapter implements Constraint {
1818
* Convenience factory method that will adapt a
1919
* Hamcrest {@link org.hamcrest.Matcher} to act as an
2020
* jMock {@link org.jmock.core.Constraint}.
21+
*
22+
* @return The jMock constraint.
2123
*/
2224
public static Constraint adapt(Matcher<?> matcher) {
2325
return new JMock1Adapter(matcher);

hamcrest/src/main/java/org/hamcrest/TypeSafeDiagnosingMatcher.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ public abstract class TypeSafeDiagnosingMatcher<T> extends BaseMatcher<T> {
2121
/**
2222
* Subclasses should implement this. The item will already have been checked
2323
* for the specific type and will never be null.
24+
*
25+
* @return boolean true/false depending if item matches matcher.
2426
*/
2527
protected abstract boolean matchesSafely(T item, Description mismatchDescription);
2628

hamcrest/src/main/java/org/hamcrest/TypeSafeMatcher.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ protected TypeSafeMatcher(ReflectiveTypeFinder typeFinder) {
4343
/**
4444
* Subclasses should implement this. The item will already have been checked for
4545
* the specific type and will never be null.
46+
*
47+
* @return boolean true/false depending if item matches matcher.
4648
*/
4749
protected abstract boolean matchesSafely(T item);
4850

hamcrest/src/main/java/org/hamcrest/beans/HasProperty.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public void describeTo(Description description) {
4848
*
4949
* @param propertyName
5050
* the name of the JavaBean property that examined beans should possess
51+
* @return The matcher.
5152
*/
5253
public static <T> Matcher<T> hasProperty(String propertyName) {
5354
return new HasProperty<T>(propertyName);

hamcrest/src/main/java/org/hamcrest/beans/HasPropertyWithValue.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ public Condition<Method> apply(PropertyDescriptor property, Description mismatch
159159
* the name of the JavaBean property that examined beans should possess
160160
* @param valueMatcher
161161
* a matcher for the value of the specified property of the examined bean
162+
* @return The matcher.
162163
*/
163164
public static <T> Matcher<T> hasProperty(String propertyName, Matcher<?> valueMatcher) {
164165
return new HasPropertyWithValue<>(propertyName, valueMatcher);
@@ -176,6 +177,7 @@ public static <T> Matcher<T> hasProperty(String propertyName, Matcher<?> valueMa
176177
* the dot-separated path from the examined object to the JavaBean property
177178
* @param valueMatcher
178179
* a matcher for the value of the specified property of the examined bean
180+
* @return The matcher.
179181
*/
180182
public static <T> Matcher<T> hasPropertyAtPath(String path, Matcher<T> valueMatcher) {
181183
List<String> properties = Arrays.asList(path.split("\\."));

hamcrest/src/main/java/org/hamcrest/beans/SamePropertyValuesAs.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ private static Object readProperty(Method method, Object target) {
151151
* the bean against which examined beans are compared
152152
* @param ignoredProperties
153153
* do not check any of these named properties.
154+
* @return The matcher.
154155
*/
155156
public static <B> Matcher<B> samePropertyValuesAs(B expectedBean, String... ignoredProperties) {
156157
return new SamePropertyValuesAs<>(expectedBean, asList(ignoredProperties));

hamcrest/src/main/java/org/hamcrest/collection/ArrayMatching.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public class ArrayMatching {
2626
*
2727
* @param elementMatcher
2828
* the matcher to apply to elements in examined arrays
29+
* @return The matcher.
2930
*/
3031
public static <T> Matcher<T[]> hasItemInArray(Matcher<? super T> elementMatcher) {
3132
return new HasItemInArray<>(elementMatcher);
@@ -40,6 +41,7 @@ public static <T> Matcher<T[]> hasItemInArray(Matcher<? super T> elementMatcher)
4041
*
4142
* @param element
4243
* the element that should be present in examined arrays
44+
* @return The matcher.
4345
*/
4446
public static <T> Matcher<T[]> hasItemInArray(T element) {
4547
return hasItemInArray(equalTo(element));
@@ -64,6 +66,7 @@ public static <T> Matcher<T[]> hasItemInArray(T element) {
6466
*
6567
* @param itemMatchers
6668
* a list of matchers, each of which must be satisfied by an entry in an examined array
69+
* @return The matcher.
6770
*/
6871
@SafeVarargs
6972
public static <E> Matcher<E[]> arrayContainingInAnyOrder(Matcher<? super E>... itemMatchers) {
@@ -89,6 +92,7 @@ public static <E> Matcher<E[]> arrayContainingInAnyOrder(Matcher<? super E>... i
8992
*
9093
* @param itemMatchers
9194
* a list of matchers, each of which must be satisfied by an item provided by an examined array
95+
* @return The matcher.
9296
*/
9397
public static <E> Matcher<E[]> arrayContainingInAnyOrder(Collection<Matcher<? super E>> itemMatchers) {
9498
return new ArrayAsIterableMatcher<>(new IsIterableContainingInAnyOrder<>(itemMatchers), itemMatchers, "in any order");
@@ -111,6 +115,7 @@ public static <E> Matcher<E[]> arrayContainingInAnyOrder(Collection<Matcher<? su
111115
*
112116
* @param items
113117
* the items that must equal the entries of an examined array, in any order
118+
* @return The matcher.
114119
*/
115120
@SafeVarargs
116121
public static <E> Matcher<E[]> arrayContainingInAnyOrder(E... items) {
@@ -126,6 +131,7 @@ public static <E> Matcher<E[]> arrayContainingInAnyOrder(E... items) {
126131
*
127132
* @param items
128133
* the items that must equal the items within an examined array
134+
* @return The matcher.
129135
*/
130136
@SafeVarargs
131137
public static <E> Matcher<E[]> arrayContaining(E... items) {
@@ -140,6 +146,7 @@ public static <E> Matcher<E[]> arrayContaining(E... items) {
140146
*
141147
* @param itemMatchers
142148
* the matchers that must be satisfied by the items in the examined array
149+
* @return The matcher.
143150
*/
144151
@SafeVarargs
145152
public static <E> Matcher<E[]> arrayContaining(Matcher<? super E>... itemMatchers) {
@@ -159,6 +166,7 @@ public static <E> Matcher<E[]> arrayContaining(Matcher<? super E>... itemMatcher
159166
*
160167
* @param itemMatchers
161168
* a list of matchers, each of which must be satisfied by the corresponding item in an examined array
169+
* @return The matcher.
162170
*/
163171
public static <E> Matcher<E[]> arrayContaining(List<Matcher<? super E>> itemMatchers) {
164172
return new ArrayAsIterableMatcher<>(new IsIterableContainingInOrder<>(itemMatchers), itemMatchers, "");

hamcrest/src/main/java/org/hamcrest/collection/IsArray.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ public void describeTo(Description description) {
5555
*
5656
* Can be overridden in subclasses to customise how the matcher is
5757
* described.
58+
*
59+
* @return The description prefix.
5860
*/
5961
protected String descriptionStart() {
6062
return "[";
@@ -65,6 +67,8 @@ protected String descriptionStart() {
6567
*
6668
* Can be overridden in subclasses to customise how the matcher is
6769
* described.
70+
*
71+
* @return The description separator.
6872
*/
6973
protected String descriptionSeparator() {
7074
return ", ";
@@ -75,6 +79,8 @@ protected String descriptionSeparator() {
7579
*
7680
* Can be overridden in subclasses to customise how the matcher is
7781
* described.
82+
*
83+
* @return The description suffix.
7884
*/
7985
protected String descriptionEnd() {
8086
return "]";
@@ -89,6 +95,7 @@ protected String descriptionEnd() {
8995
*
9096
* @param elementMatchers
9197
* the matchers that the elements of examined arrays should satisfy
98+
* @return The matcher.
9299
*/
93100
public static <T> IsArray<T> array(Matcher<? super T>... elementMatchers) {
94101
return new IsArray<T>(elementMatchers);

hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInAnyOrder.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public void describeTo(Description description) {
5757
*
5858
* @param itemMatchers
5959
* a list of matchers, each of which must be satisfied by an entry in an examined array
60+
* @return The matcher.
6061
*/
6162
public static <E> Matcher<E[]> arrayContainingInAnyOrder(Matcher<? super E>... itemMatchers) {
6263
return arrayContainingInAnyOrder(Arrays.asList(itemMatchers));
@@ -79,6 +80,7 @@ public static <E> Matcher<E[]> arrayContainingInAnyOrder(Matcher<? super E>... i
7980
*
8081
* @param itemMatchers
8182
* a list of matchers, each of which must be satisfied by an item provided by an examined array
83+
* @return The matcher.
8284
*/
8385
public static <E> Matcher<E[]> arrayContainingInAnyOrder(Collection<Matcher<? super E>> itemMatchers) {
8486
return new IsArrayContainingInAnyOrder<E>(itemMatchers);
@@ -101,6 +103,7 @@ public static <E> Matcher<E[]> arrayContainingInAnyOrder(Collection<Matcher<? su
101103
*
102104
* @param items
103105
* the items that must equal the entries of an examined array, in any order
106+
* @return The matcher.
104107
*/
105108
public static <E> Matcher<E[]> arrayContainingInAnyOrder(E... items) {
106109
List<Matcher<? super E>> matchers = new ArrayList<Matcher<? super E>>();

0 commit comments

Comments
 (0)