Interface Emptyable
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Marks objects that can meaningfully be said to be empty. An example could be a POJO with all fields set to
their default values. Classes that implement this interface get a free ride on the
empty()
, notEmpty()
and
deepNotEmpty()
checks from the CommonChecks
class. That is,
instances of Emptyable
can be tested using:
Check.that(myPojo).isNot(empty());
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
Returnstrue
if this is a recursively non-empty instance.boolean
isEmpty()
Returnstrue
if this is an empty instance.
-
Method Details
-
isEmpty
boolean isEmpty()Returnstrue
if this is an empty instance.- Returns:
true
if this is an empty instance
-
isDeepNotEmpty
default boolean isDeepNotEmpty()Returnstrue
if this is a recursively non-empty instance. The default implementation returns the negation ofisEmpty()
.- Returns:
true
if this is a recursively non-empty instance
-