-
Notifications
You must be signed in to change notification settings - Fork 150
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
Make format/s non private #49
Conversation
@@ -354,6 +354,34 @@ object GreetingForm { | |||
} | |||
``` | |||
|
|||
Another alternative (if for example your `Enum` cant extend `PlayEnum` or `PlayFormFieldEnum`) is to create an implicit `Format` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small typo: cant → can't
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Thanks this sounds reasonable, just have a small typo in there that needs fixing and we're good to go 👍 |
Thanks. 1.4.8 should in the next hour or so be in Maven Central. |
This makes the various
format
methods non private. The reasoning is that, if you are unable to make your enums extendPlayEnum
or its variants, the only way to create a mapping using an enum is to make a reference to it with theenum
method, i.e.Unfortunately the only way you can use this mapping is by reference to a variable, not its type
This is because play doesn't have any way to bring an implicit
Mapping
into scope, only an implicitFormatter
. Making the format non privates means that you can do thisAnd then you can use plays
of
to summon an implicitFormat
from scope