Add support of different levels of visibility for generated code
This may be useful for library developers to restrict something or rearrange the APIs.
It may be implemented as following:
enum class VisibilityLevel {
Public,
Internal,
} // no reasons to make it private or protected
@GenSealedEnum( // the actual usage
extensionsVisibility = VisibilityLevel.Internal,
objectVisibility = VisibilityLevel.Internal, // it's important to have separate visibility settings for extensions vs objects
)
The functionality may be used by library developers to hide some of the methods, or to implement it as actual fields and not as extensions.
Thanks for the suggestion!
Would making the companion object or the sealed class internal work for your use case? Or would you want to be able to have a public companion object along with internal extensions?
implement it as actual fields and not as extensions. I'm curious to hear more there as well. Would that be generating the sealed enum with
@GenSealedEnum, but then not using the generated code for some of the implementations?
I'd prefer to have both of these configurable :)