Less verbose enum usage in java annotations -
this question has answer here:
i want use custom annotation in java project. curretnly i'm having this:
@parallel(synchronicity=sync.sync, concurrency=conc.mutex)
sync , conc both enums.
this little verbose. not synchronicity long word, have specify enum name. prefer write in 1 of following ways:
@parallel(synchronicity=sync, concurrency=mutex) @parallel(sync.sync, conc.mutex)
but both don't seem possible. have idea on how make usage of enums in annotation less verbose?
add
import static com.foo.bar.sync.*; import static com.foo.bar.conc.*;
to imports, able use
@parallel(synchronicity=sync, concurrency=mutex)
Comments
Post a Comment