Skip to content
This repository has been archived by the owner on May 26, 2020. It is now read-only.

Add integer enum support. #123

Merged
merged 1 commit into from
Jul 26, 2018
Merged

Add integer enum support. #123

merged 1 commit into from
Jul 26, 2018

Conversation

MartinYSpasov
Copy link
Contributor

No description provided.

@coveralls
Copy link

coveralls commented Jul 26, 2018

Coverage Status

Coverage increased (+0.0008%) to 99.86% when pulling 8760257 on add-integer-enum-support into 51fc847 on master.

@@ -71,7 +77,7 @@ private MethodSpec buildToStringMethod() {
.addAnnotation(Override.class)
.addModifiers(PUBLIC)
.returns(String.class)
.addStatement("return $L", VALUE_VARIABLE_NAME)
.addStatement("return $L", isNumericEnum ? "String.valueOf(".concat(VALUE_VARIABLE_NAME).concat(")") : VALUE_VARIABLE_NAME)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks quite complicated for an inline switch...it might be better as a method that returns a CodeBlock according to the switch and added using .addCode method

@mapingo mapingo merged commit 6cf5655 into master Jul 26, 2018
@mapingo mapingo deleted the add-integer-enum-support branch July 26, 2018 14:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants