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

Better support for fields nullability by Annotation Processors #595

Closed
xdmaolei opened this issue Jan 18, 2016 · 3 comments
Closed

Better support for fields nullability by Annotation Processors #595

xdmaolei opened this issue Jan 18, 2016 · 3 comments
Assignees
Milestone

Comments

@xdmaolei
Copy link

public ContentValues mapToContentValues(@NonNull ReplyBean object) {
    ContentValues contentValues = new ContentValues(2);

    if(object.content != null){
        contentValues.put("content", object.content);
    }
    if(object.key!= null){
        contentValues.put("key", object.key);
    }

    return contentValues;
}

First I appreciate your work, I think It will be helpful to check the properties whether they are null, and the properties should be non-primitive

@artem-zinnatullin
Copy link
Member

Well, columns may be null in SQLite. But we may add support for Nullability annotations in our annotation processor, will it be ok for you?

@xdmaolei
Copy link
Author

Thanks, it'll be OK

@artem-zinnatullin artem-zinnatullin changed the title Update with object may introduce bugs Better support for fields nullability by Annotation Processors Jan 20, 2016
@nikitin-da
Copy link
Collaborator

Hi, @xdmaolei!
We may add property ignoreNull for annotation processor, but it will be quite difficult to clear this field.
Is it acceptable for your case or do you see a way to clear, except using another put resolver?

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

No branches or pull requests

3 participants