-
-
Notifications
You must be signed in to change notification settings - Fork 156
Closed as not planned
accordproject/concerto-codegen
#103Closed as not planned
Copy link
Labels
Description
It would be convenient to provide a way to easily get the string name for enumerated values. For instance to get the name of a currencyCode as a Java String.
Context
It's not a bug, but feature request.
Expected Behavior
Calling myEnum.toString() should return the name of the enum as a Java String.
Actual Behavior
The application has to create string representations (e.g., through myEnum.name()) by hand.
Possible Fix
Add a toString() method for enums, maybe using .name() for enums.
Steps to Reproduce
N/A
Existing issues
None found.
Context
Working on an application where CTO models are generated to Java with additional fixes for the Corda network. Monetary amounts CTO representations which include an enum for currency codes are converted to Java Currency classes.
Your Environment
- Version used: 0.70.2
- Environment name and version (e.g. Chrome 39, node.js 5.4): node 8
- Operating System and version (desktop or mobile): MacOS
- Link to your project: https://github.com/accordproject/cicero