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

Access map with enum as key #237

Closed
muras opened this issue Oct 16, 2013 · 3 comments
Closed

Access map with enum as key #237

muras opened this issue Oct 16, 2013 · 3 comments
Milestone

Comments

@muras
Copy link

muras commented Oct 16, 2013

Hi,

How to access map with enum as key in handlebars.java?

We have:
public enum Status {
NEW, DONE, CLOSED
}

Model:
Map<Status, Long> statuses = new HashMap();
statuses.put(Status.CLOSED, 1);
statuses.put(Status.DONE, 2);
statuses.put(Status.NEW, 3);

For example {{statuses.NEW}} doesn't work.

@jknack
Copy link
Owner

jknack commented Oct 16, 2013

yea, I experienced the same last week and isn't possible and not sure how to fix it :(

@muras
Copy link
Author

muras commented Oct 17, 2013

Changing Map (Statuses, Integer) to Map (String, Integer) is simple workaround.
But it could be nice to support enum values out of the box.

jknack added a commit that referenced this issue Oct 28, 2013
@jknack
Copy link
Owner

jknack commented Oct 28, 2013

fixed in 1.1.3-SNAPSHOT IF and ONLY IF you use an: EnumMap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants