Interface ChildSupplier


public interface ChildSupplier
Utility to provide vararg children to AbstractModel constructors while also covering null cases.
Author:
Matt Coley
  • Method Details

    • of

      @Nonnull static ChildSupplier of(@Nullable Model model)
      Parameters:
      model - Model to supply.
      Returns:
      Single item supplier.
    • of

      @Nonnull static ChildSupplier of(@Nonnull Collection<? extends Model> models)
      Parameters:
      models - Collection of models to supply.
      Returns:
      Multiple item supplier.
    • of

      @Nonnull static ChildSupplier of(Model... models)
      Parameters:
      models - Array of models to supply.
      Returns:
      Multiple item supplier.
    • isSingle

      boolean isSingle()
      Returns:
      true for when getSingle() should be used. false for when getMultiple() should be used.
    • getSingle

      @Nonnull Model getSingle()
      Returns:
      Single supplied child model.
    • getMultiple

      @Nonnull Collection<? extends Model> getMultiple()
      Returns:
      Multiple supplied child models.