Friday, May 17, 2013

one more null check with Optional

Instead of
    if (tipDocument.isPresent()) {
      return tipDocument.get();
    }
    return null;
use
return tipDocument.orNull();

No comments:

Post a Comment