I've got some generic processors that get invoked by a framework. Argument is the payload that I process.
interface Processor<T, U> {
U process(T t);
}
There are situations in which payload makes no sense and does not exist (only response is calculated and returned). In that case the framework passes null
as argument. I decided to use javax.lang.model.type.NullType
for that purpose:
new Processor<NullType, String>() {
public String process(NullType unused) {
...
return result;
}
}
Am I misusing the intention of NullType
here? Is java.lang.Void
or something else more appropriate?