Skip to content

Commit 5e6a4cb

Browse files
committed
Add some common method matchers
1 parent 13d76fc commit 5e6a4cb

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

class-match/src/main/java/datadog/instrument/classmatch/AccessMatcher.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ public interface AccessMatcher extends IntPredicate {
2525
/** Matches protected access. */
2626
AccessMatcher PROTECTED = Modifier::isProtected;
2727

28+
/** Matches package-private access. */
29+
AccessMatcher PACKAGE_PRIVATE =
30+
acc -> (acc & (Modifier.PUBLIC | Modifier.PROTECTED | Modifier.PRIVATE)) == 0;
31+
2832
/** Matches static access. */
2933
AccessMatcher STATIC = Modifier::isStatic;
3034

@@ -40,15 +44,15 @@ public interface AccessMatcher extends IntPredicate {
4044
/** Matches synchronized methods. */
4145
AccessMatcher SYNCHRONIZED = Modifier::isSynchronized;
4246

47+
/** Matches varargs methods. */
48+
AccessMatcher VARARGS = acc -> (acc & 0x0080) != 0;
49+
4350
/** Matches volatile fields. */
4451
AccessMatcher VOLATILE = Modifier::isVolatile;
4552

4653
/** Matches transient fields. */
4754
AccessMatcher TRANSIENT = Modifier::isTransient;
4855

49-
/** Matches native methods. */
50-
AccessMatcher NATIVE = Modifier::isNative;
51-
5256
/** Matches interface classes. */
5357
AccessMatcher INTERFACE = Modifier::isInterface;
5458

0 commit comments

Comments
 (0)