Is there a class equivalent of custom annotations in java? -


i need have set of annotated interfaces corresponding enum

for eg:

enum type {   a,   b,   c } 

i using custom annotations ensure don't have define multiple annotations (there lot of types in use case)

@interface typeannotation {   type value(); } 

unfortunately there nothing can define interfaces this. hence, have make multiple classes like:-

@typeannotation(type.a) public interface typeainterface {}  @typeannotation(type.b) public interface typebinterface {} .... 

i don't need define inside these interfaces, need define annotated interfaces use in framework using. hence, looking analogue custom annotations save me boilerplate.

a generic type generic class or interface parameterized on types. i'm looking generic interface parameterized on enum values.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -