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

Problem with generics in List #185

Open
dmitrikudrenko opened this issue Oct 24, 2016 · 2 comments
Open

Problem with generics in List #185

dmitrikudrenko opened this issue Oct 24, 2016 · 2 comments

Comments

@dmitrikudrenko
Copy link

I have a model structure like with:

@JsonObject
abstract class SearchResult<T> {
    @JsonField
    var total: Int = 0
    @JsonField
    var count: Int = 0
    @JsonField
    var limit: Int = 0
    @JsonField
    var offset: Int = 0
    @JsonField
    var items: List<T>? = null
}

@JsonObject
class CategorySearchResult : SearchResult<Category>()

In compilation I receive the error 'Error:@JsonField annotation can only be used on private fields if both getter and setter are present.'. When I comment @JsonField at List, the error disappeared. How can I avoid the problem?

@bahacan19
Copy link

+1

@saeedata
Copy link

use ArrayList instead of List

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

3 participants