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

Allow DataObject properties to be ignored by generated converter #213

Open
rgmz opened this issue Sep 30, 2018 · 0 comments
Open

Allow DataObject properties to be ignored by generated converter #213

rgmz opened this issue Sep 30, 2018 · 0 comments

Comments

@rgmz
Copy link
Contributor

rgmz commented Sep 30, 2018

In certain circumstances it is desirable or necessary to omit a property from the generated converter.

For example, the following Kotlin DataObject will not compile successfully:

@DataObject(generateConverter = true)
class EnumSetDataObject() {
    var enumSet: Set<MyEnum> = emptySet()
    ...
}

error: Could not generate element for io.vertx.example.EnumSetDataObject: 
Illegal type ? extends io.vertx.example.MyEnum of kind WILDCARD

The desired effect (omitting enumSet from the converter) can be accomplished in Kotlin by using the @JvmField annotation, however, that is a language-specific solution.

I think that it would be useful to provide this functionality, either via the @GenIgnore annotation or a new @ConverterIgnore annotation.

@rgmz
Copy link
Contributor Author

rgmz commented Apr 26, 2021

Update: one way of accomplishing this, in Kotlin, is to use the @JvmField annotation as described in #330.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant