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

Enum injection #101

Closed
ivanjunckes opened this issue Aug 2, 2018 · 5 comments
Closed

Enum injection #101

ivanjunckes opened this issue Aug 2, 2018 · 5 comments
Milestone

Comments

@ivanjunckes
Copy link

Hi guys,

These are the supported values:
java.lang.String
• java.lang.Long
• java.lang.Boolean
• java.util.Set<java.lang.String>
• javax.json.JsonValue.TRUE/FALSE
• javax.json.JsonString
• javax.json.JsonNumber
• javax.json.JsonArray
• javax.json.JsonObject

Shouldn't we also support Enum classes? Strings could be transformed to a Enum using valueOf if the injection point is an Enum class.

What do you guys think?

@dblevins
Copy link
Contributor

dblevins commented Aug 2, 2018

We should have identical conversion capabilities as the Config API. Last I checked they were something like the following:

  • public TheType(String) produce an instance using public string constructor on the type itself.
  • public static TheType parse(String) produce an instance using a static factory on the type itself.

There's an order of precedence and if I recall correctly at least one supported more static factory pattern.

@starksm64 starksm64 added this to the 2.0 milestone Aug 9, 2018
@starksm64
Copy link
Contributor

I think this makes sense.

@radcortez
Copy link
Contributor

Related with #114

@sberyozkin
Copy link
Contributor

Is it a duplicate of #100 ?

@sberyozkin
Copy link
Contributor

Hi @ivanjunckes all, copying your requirement to #100, to keep it all centralized in one place;
CC @dblevins, @radcortez
thanks

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

5 participants