Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support of different levels of visibility for generated code #113

Open
bvitaliyg opened this issue Aug 10, 2022 · 2 comments
Open

Add support of different levels of visibility for generated code #113

bvitaliyg opened this issue Aug 10, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@bvitaliyg
Copy link

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.

@alexvanyo
Copy link
Collaborator

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?

@bvitaliyg
Copy link
Author

I'd prefer to have both of these configurable :)

@alexvanyo alexvanyo self-assigned this Apr 5, 2023
@alexvanyo alexvanyo added the enhancement New feature or request label Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants