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

[Feature] Provide a toString() method for enumerated values in Java #100

Open
3 tasks done
jeromesimeon opened this issue May 15, 2019 · 3 comments · May be fixed by accordproject/concerto-codegen#103
Open
3 tasks done
Labels

Comments

@jeromesimeon
Copy link
Member

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

@stale
Copy link

stale bot commented Jul 14, 2019

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs in the next 14 days. Thank you for your contributions.

@stale
Copy link

stale bot commented Jul 28, 2019

This issue has been automatically closed because no further activity occurred. If you believe the issue is still relevant, please either reopen this issue, open a new issue, or contact one of the project maintainers

Copy link
Contributor

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants