지금 적용중인 구글 블로그 Template
http://gooyaabitemplates.com/livepreview/the-funk/
페이징 수정
stackedit로 작성한 글 변경...
26 Reasons Why Using Optional Correctly Is Not Optional
1. Never Assign Null to an Optional VariableAvoid:
// AVOID
public Optional<Cart> fetchCart() {
Optional<Cart> emptyCart = null;
...
}
Prefer:
// PREFER
public Optional<Cart> fetchCart() {
Optional<Cart> emptyCart = Optional.empty();
......
Why should one use Objects.requireNonNull()?
public class Foo {
private final Bar bar;
public Foo(Bar bar) {
Objects.requireNonNull(bar, "bar must not be null");
this.bar = bar;
}
}
The major advantages are:
as said, controlled behavior
easier debugging - because you throw up in the context of the object creation. At a point in time where you have a certain chance that your logs/traces...