What’s the point of Guava checkNotNull [duplicate]
The idea is to fail fast. For instance, consider this silly class: public class Foo { private final String s; public Foo(String s) { this.s = s; } public int getStringLength() { return s.length(); } } Let’s say you don’t want to allow null values for s. (or else getStringLength will throw a NPE). With … Read more