-
Notifications
You must be signed in to change notification settings - Fork 332
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
adding method to allow choosing when to instantiate null params #660
Conversation
what do you think guys? (note: docs coming soon) |
Instantiator<Object> objectInstantiator = new ObjectInstantiator(this, provider, parameterNameProvider); | ||
|
||
if (!instantiateNullParameters()) { | ||
objectInstantiator = new NullDecorator(objectInstantiator); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too smart :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NullDecorator keeps nulls? If so, you shouldn't have the !
on the if.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nevermind. But the name is confusing.
I'd use something like useNullForMissingParameters
with false
as default. And change the method to protected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with useNullForMissingParameters
. Good point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with you guys, done here 99ae0c0
all changes applied, I'll write some docs about it before 🚢 |
docs added here #663. Can I 🐑 it? |
multiInstantiator = new MultiInstantiator(instantiatorList); | ||
} | ||
|
||
public boolean useNullForMissingParameters() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not protected, use only extended
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
protected++
:go-horse: |
adding method to allow choosing when to instantiate null params
Fixes #532