I have a piece of Java code as follows:
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
@BindingAnnotation
@Target({ FIELD, PARAMETER, METHOD })
@Retention(RUNTIME)
public @interface MessageCount {
}
This is not my code, but I am trying rewrite this in Scala. I do not understand the @interface construct very well. Nor do I understand how those annotations can be translated over to Scala. Or is it possible to use this in Scala somehow?
I prefer rewriting/porting this in Scala. The only thing I can think of is to write it as a Scala trait.
Any pointers, suggestions are appreciated.
annotation. I'm not sure it may be correctly ported to scala.