• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

raphw / byte-buddy / #642

20 Aug 2024 09:12AM CUT coverage: 85.383% (-0.006%) from 85.389%
#642

push

raphw
Delegate class reader to factories.

28757 of 33680 relevant lines covered (85.38%)

0.85 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/byte-buddy-dep/src/main/java/net/bytebuddy/matcher/AnnotationTargetMatcher.java
1
/*
2
 * Copyright 2014 - Present Rafael Winterhalter
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *     http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package net.bytebuddy.matcher;
17

18
import net.bytebuddy.build.HashCodeAndEqualsPlugin;
19
import net.bytebuddy.description.annotation.AnnotationDescription;
20

21
import java.lang.annotation.ElementType;
22

23
/**
24
 * A matcher for annotations that target a given element type.
25
 *
26
 * @param <T> The type of the matched entity.
27
 */
28
@HashCodeAndEqualsPlugin.Enhance
29
public class AnnotationTargetMatcher<T extends AnnotationDescription> extends ElementMatcher.Junction.ForNonNullValues<T> {
30

31
    /**
32
     * The targeted element type.
33
     */
34
    private final ElementType elementType;
35

36
    /**
37
     * Creates a new matcher for an annotation target.
38
     *
39
     * @param elementType The targeted element type.
40
     */
41
    public AnnotationTargetMatcher(ElementType elementType) {
×
42
        this.elementType = elementType;
×
43
    }
×
44

45
    /**
46
     * {@inheritDoc}
47
     */
48
    protected boolean doMatch(T target) {
49
        return target.isSupportedOn(elementType);
×
50
    }
51

52
    @Override
53
    public String toString() {
54
        return "targetsElement(" + elementType + ")";
×
55
    }
56
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc