I write a library that should rely on enums but the actual enum should be defined be the user of my library.
In the following example the authorize
method requires parameters of the enum type Permission
.
acl.authorize(userX, Permission.READ, Permission.WRITE)
My library should be able to handle arbitrary permissions defined by the library user. But I cannot compile my library without a Permission
enum. So I would need something like
abstract enum Permission
in my library. Is there a workaround to do this?