Java Code Examples for net.bytebuddy.matcher.ElementMatchers#none()

The following examples show how to use net.bytebuddy.matcher.ElementMatchers#none() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Promagent.java    From promagent with Apache License 2.0 5 votes vote down vote up
/**
 * Returns a byte buddy matcher matching any method contained in methodSignatures.
 */
public static ElementMatcher<MethodDescription> matchAnyMethodIn(Set<MethodSignature> methodSignatures) {
    ElementMatcher.Junction<MethodDescription> methodMatcher = ElementMatchers.none();
    for (MethodSignature methodSignature : methodSignatures) {
        ElementMatcher.Junction<MethodDescription> junction = ElementMatchers
                .named(methodSignature.getMethodName())
                .and(not(isAbstract()))
                .and(takesArguments(methodSignature.getParameterTypes().size()));
        for (int i = 0; i < methodSignature.getParameterTypes().size(); i++) {
            junction = junction.and(takesArgument(i, named(methodSignature.getParameterTypes().get(i))));
        }
        methodMatcher = methodMatcher.or(junction);
    }
    return methodMatcher;
}
 
Example 2
Source File: SoftlyReferencingTypePoolCacheTest.java    From apm-agent-java with Apache License 2.0 4 votes vote down vote up
@BeforeEach
void setUp() {
    cache = new SoftlyReferencingTypePoolCache(TypePool.Default.ReaderMode.FAST, 42, ElementMatchers.none());
}
 
Example 3
Source File: MemberRemoval.java    From byte-buddy with Apache License 2.0 4 votes vote down vote up
/**
 * Creates a new member removal instance that does not specify the removal of any methods.
 */
public MemberRemoval() {
    this(ElementMatchers.<FieldDescription.InDefinedShape>none(), ElementMatchers.<MethodDescription>none());
}