Originally posted by heyya99
View Post


public SomeObject doSomeWork(SomeInput input) {
Do a load of stuff with the input;
And some more stuff;
// Make sure we set someOtherProperty in the case that the input item is a certain thing.
for(SomeItem item : input) {
if(item.getSomeProperty() > 5) {
item.setSomeDifferentProperty("we did some special stuff to this one!");
}
}
SomeObject obj = doSomeMoreStuff;
return obj;
}
public SomeObject doSomeWork(SomeInput input) {
Do a load of stuff with the input;
And some more stuff;
setThatSpecialValueWhereInputItemsAreSpecial(input);
SomeObject obj = doSomeMoreStuff;
return obj;
}
private void setThatSpecialValueWhereInputItemsAreSpecial(SomeInput input) {
for(SomeItem item : input) {
if(item.getSomeProperty() > 5) {
item.setSomeDifferentProperty("we did some special stuff to this one!");
}
}
}

Comment