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 for storing and retrieving properties based on enums #20

Closed
wants to merge 1 commit into from

Conversation

plackemacher
Copy link
Contributor

@plackemacher plackemacher commented Oct 20, 2016

Should resolve #18. The option I went with is to provide an enum's possible values as the first argument when defining the preference variable. Another option could be to provide the enum's class itself and then using enumConstants to retrieve the list instead. That could be a bit cleaner but may require usage of kotlin-reflection which some library users might not find desirable.

@plackemacher plackemacher mentioned this pull request Oct 20, 2016
@chibatching
Copy link
Owner

chibatching commented Oct 20, 2016

Thank you for your PR! 😄

I prefer to use enumConstans because it is cleaner to use.
And my bit research, enumConstants doesn't need kotlin-reflection. It's method of java.lang.Class.

Would you fix it?

@plackemacher
Copy link
Contributor Author

plackemacher commented Oct 20, 2016

No problem! 👍

I'll fix it up tonight. 😃

@plackemacher
Copy link
Contributor Author

@chibatching updated!

@chibatching
Copy link
Owner

Merged into master with small fix, thank you!

@plackemacher plackemacher deleted the enums branch November 2, 2016 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enum support?
2 participants