Interface Emptyable

All Known Implementing Classes:
Result
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Emptyable
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(myEmptyablePojo).isNot(empty());
 
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Returns true if this is a recursively non-empty instance.
    boolean
    Returns true if this is an empty instance.
  • Method Details

    • isEmpty

      boolean isEmpty()
      Returns true if this is an empty instance.
      Returns:
      true if this is an empty instance
    • isDeepNotEmpty

      default boolean isDeepNotEmpty()
      Returns true if this is a recursively non-empty instance. The default implementation returns the negation of isEmpty().
      Returns:
      true if this is a recursively non-empty instance