The exception point is the transfer of exceptional situations.
: , , , RuntimeException ; , , :
throw new RuntimeException("All conditions failed: " + some data)
: ; , . , , false.
, ; . : , , @throws RuntimeException .
RuntimeException ; .
: , . : :
public class Whatever {
private final Foo theFoo;
public Whatever(Foo theFoo) {
Objects.requireNonNull(theFoo, "theFoo must not be null");
this.theFoo = theFoo;
, NPE, ; . : . , ; , .
: ; "" : , ; , , .
; - - . - , - ! , : . , , " ". , , : !