I have one interface on the legacy project which defines as follows:
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.METHOD})
public @interface Statistic {
String name();
}
.So here @interface are followed with two annotations i.e.(@Retention & @Target). Is anybody can explain how this interface works and what would be the good place to use it. I am quite new with these one.
Moreover, I can see on the project code somewhere using this interface with annotating like below:
@Statistic(name="DDB/received") private int docReceived = 0;
What does this really meant? Can anybody elaborate clearly? Thanks