@Inherited @Documented @Retention(value=RUNTIME) @Target(value={TYPE,CONSTRUCTOR,METHOD}) public @interface Counted
@Counted(name = "fancyName")
public String fancyName(String name) {
return "Sir Captain " + name;
}
A counter for the defining class with the name fancyName
will be created and each time the
#fancyName(String)
method is invoked, the counter will be marked.public abstract String name
public abstract boolean absolute
true
, use the given name as an absolute name. If false
, use the given name
relative to the annotated class. When annotating a class, this must be false
.public abstract boolean monotonic
false
(default), the counter is decremented when the annotated
method returns, counting current invocations of the annotated method.
If true
, the counter increases monotonically, counting total
invocations of the annotated method.Copyright © 2014. All Rights Reserved.