You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Matchers reflective elements that have public visibility.
19
-
* Specifically, this matcher only matches elements marked with the keyword {@code public}.
20
-
* <br>
21
-
* This method matches {@link Class} objects or other {@link java.lang.reflect.Member reflective objects}
22
-
* like {@link java.lang.reflect.Field} or {@link java.lang.reflect.Method} used in reflection.
23
-
* Any other kind of object, or {@code null} values, do not match (but will not cause an Exception).
24
-
*
25
-
* @param <T>
26
-
* the type of the object being matched
27
-
* @return a matcher that matches reflective elements with exactly the given level of visibility
28
-
*/
29
-
@SuppressWarnings("unchecked")
30
-
publicstatic <T> Matcher<T> isPublic()
31
-
{
32
-
// Each matcher is stateless and can match any type (the generic <T> is for type safety at the use site),
33
-
// so it's fine to cast the non-reifiable generic type here at runtime and re-use the same instance.
34
-
return (Matcher<T>) PUBLIC;
35
-
}
18
+
/**
19
+
* Matchers reflective elements that have public visibility.
20
+
* Specifically, this matcher only matches elements marked with the keyword {@code public}.
21
+
* <br>
22
+
* This method matches {@link Class} objects or other {@link java.lang.reflect.Member reflective objects}
23
+
* like {@link java.lang.reflect.Field} or {@link java.lang.reflect.Method} used in reflection.
24
+
* Any other kind of object, or {@code null} values, do not match (but will not cause an Exception).
25
+
*
26
+
* @param <T> the type of the object being matched
27
+
* @return a matcher that matches reflective elements with exactly the given level of visibility
28
+
*/
29
+
@SuppressWarnings("unchecked")
30
+
publicstatic <T> Matcher<T> isPublic() {
31
+
// Each matcher is stateless and can match any type (the generic <T> is for type safety at the use site),
32
+
// so it's fine to cast the non-reifiable generic type here at runtime and re-use the same instance.
33
+
return (Matcher<T>) PUBLIC;
34
+
}
36
35
37
-
/**
38
-
* Matchers reflective elements that have protected visibility.
39
-
* Specifically, this matcher only matches elements marked with the keyword {@code protected}; it does NOT match public or private elements.
40
-
* <br>
41
-
* This method matches {@link Class} objects or other {@link java.lang.reflect.Member reflective objects}
42
-
* like {@link java.lang.reflect.Field} or {@link java.lang.reflect.Method} used in reflection.
43
-
* Any other kind of object, or {@code null} values, do not match (but will not cause an Exception).
44
-
*
45
-
* @param <T>
46
-
* the type of the object being matched
47
-
* @return a matcher that matches reflective elements with exactly the given level of visibility
48
-
*/
49
-
@SuppressWarnings("unchecked")
50
-
publicstatic <T> Matcher<T> isProtected()
51
-
{
52
-
// Each matcher is stateless and can match any type (the generic <T> is for type safety at the use site),
53
-
// so it's fine to cast the non-reifiable generic type here at runtime and re-use the same instance.
54
-
return (Matcher<T>) PROTECTED;
55
-
}
36
+
/**
37
+
* Matchers reflective elements that have protected visibility.
38
+
* Specifically, this matcher only matches elements marked with the keyword {@code protected}; it does NOT match public or private elements.
39
+
* <br>
40
+
* This method matches {@link Class} objects or other {@link java.lang.reflect.Member reflective objects}
41
+
* like {@link java.lang.reflect.Field} or {@link java.lang.reflect.Method} used in reflection.
42
+
* Any other kind of object, or {@code null} values, do not match (but will not cause an Exception).
43
+
*
44
+
* @param <T> the type of the object being matched
45
+
* @return a matcher that matches reflective elements with exactly the given level of visibility
46
+
*/
47
+
@SuppressWarnings("unchecked")
48
+
publicstatic <T> Matcher<T> isProtected() {
49
+
// Each matcher is stateless and can match any type (the generic <T> is for type safety at the use site),
50
+
// so it's fine to cast the non-reifiable generic type here at runtime and re-use the same instance.
51
+
return (Matcher<T>) PROTECTED;
52
+
}
56
53
57
-
/**
58
-
* Matchers reflective elements that have package-protected visibility.
59
-
* Specifically, this matcher only matches elements not marked with any of the visibility keywords {@code public}, {@code protected}, or {@code private}.
60
-
* <br>
61
-
* This method matches {@link Class} objects or other {@link java.lang.reflect.Member reflective objects}
62
-
* like {@link java.lang.reflect.Field} or {@link java.lang.reflect.Method} used in reflection.
63
-
* Any other kind of object, or {@code null} values, do not match (but will not cause an Exception).
64
-
*
65
-
* @param <T>
66
-
* the type of the object being matched
67
-
* @return a matcher that matches reflective elements with exactly the given level of visibility
68
-
*/
69
-
@SuppressWarnings("unchecked")
70
-
publicstatic <T> Matcher<T> isPackageProtected()
71
-
{
72
-
// Each matcher is stateless and can match any type (the generic <T> is for type safety at the use site),
73
-
// so it's fine to cast the non-reifiable generic type here at runtime and re-use the same instance.
74
-
return (Matcher<T>) PACKAGE_PROTECTED;
75
-
}
54
+
/**
55
+
* Matchers reflective elements that have package-protected visibility.
56
+
* Specifically, this matcher only matches elements not marked with any of the visibility keywords {@code public}, {@code protected}, or {@code private}.
57
+
* <br>
58
+
* This method matches {@link Class} objects or other {@link java.lang.reflect.Member reflective objects}
59
+
* like {@link java.lang.reflect.Field} or {@link java.lang.reflect.Method} used in reflection.
60
+
* Any other kind of object, or {@code null} values, do not match (but will not cause an Exception).
61
+
*
62
+
* @param <T> the type of the object being matched
63
+
* @return a matcher that matches reflective elements with exactly the given level of visibility
0 commit comments