-
Notifications
You must be signed in to change notification settings - Fork 102
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
Thrown an exception if a value is not within an Enum #346
Comments
Is this a question or a bug report? If a bug report, what is the proposed expected behavior and the behavior seen? |
My apologies on being ambiguous. It is a bug report. Observed behavior(Context): Lets say you have a domainObject(Places) and the enum(Capital)
When I send the below Map The returned object will have the attribute's( capital) value as null (converted from HashMap's XYZ) Bug Scenario After executing the above call, I will receive the Object Places with the attribute as null with no indication that it couldn't find the value XYZ.
Bug Reason: Follow up question
Thanks, Let me know if you need any further details. |
Ok so you have two things here. A bug. I agree that if we can't parse it to an ENUM that we should throw an exception, and the other is a feature request. You will want to file a second issue for the feature request. I can't say when I will work on this. It gets done in spurts. But it should be an easy fix. I accept pull requests. |
Sounds good. Ill create a pull request after I work on it. Thanks Richard. |
If there is an Enum
enum capital { Sacaremento, Austin }
and you are eventually calling the fromMap in MapperComplex.java. whille it is doing the conversion for that attribute (say, attribute(is of enum type Capital)). If it cannot find within that Capital enum, then can you detect it by triggering an exception?
Example, EnumValueNotFoundException(attribute:capital, message:"Entered XYZ is not a valid capital.")
The text was updated successfully, but these errors were encountered: