Hi Andreas,
We can't remove APIs without deprecating them for a release cycle first.

So the only solution is the add more API methods.

If we add a new setDoubleObject method, we would need to add setBooleanObject, 
etc to keep the API consistent.

I would not favour the change you are proposing generally. While the API is not 
to your liking, adding a whole extra set of null friendly sets (and possibly 
gets) would make the API even larger and for me, the benefit is not great 
enough. Other devs might have different opinions on this.

Developers can also add their own helper methods to do this sort of thing.


public static void setCellValue(Cell c, Double d) {
  if (d == null) {
    cell.setBlank();
  } else {
    cell.setValue(d);
  }
}






On Tuesday 14 December 2021, 08:19:07 GMT+1, Andreas Reichel 
<andr...@manticore-projects.com> wrote: 





Compliments of the season,

please allow me to ask: why exactly does the Cell interface define

setValue(double value)

instead of

setValue(Double value)

which would allow for setting NULL values?

I understand, that I am supposed to use setBlank() instead but when you
create very large Excel file pragmatically, then it is very cumbersome
to check every single Value for NULL first in order to setValue() or
setBlank().
Was there a chance to change/amend setValue() to use Objects instead of
primitives only? (I would volunteer with a PR of course).

Warm regards
Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@poi.apache.org
For additional commands, e-mail: user-h...@poi.apache.org

Reply via email to