Package org.coliper.ibean.extension
Interface NullSafe
-
public interface NullSafe
Marker extension interface that injects getter calls in a way that if a getter is called on a field with valuenull
it throws anNullSafetyException
.This of course gives no real protection of null-pointer cases. It just gives a sort of an early detection during runtime. A more recommended way to prevent null errors is to work with mandatory and optional fields, for example by using Java's
Optional
in conjunction with IBean'sCompletable
,ClassicBeanStyleWithOptionalSupport
,ModernBeanStyle
.