[Java8] Supplier Functional Interface

From wikipedia

  • Manufacturer, uses tools and labour to make things for sale
    • Processor (manufacturing), converts a product from one form to another
  • Wholesaler, sells goods or merchandise to retailers
  • Merchant, a professional dealing with trade

From java definition

Represents a supplier of results. There is no requirement that a new or distinct result be returned each time the supplier is invoked.

Here are some test cases.
Gets a result.

   public void testGetCurrentDate()
      Supplier<LocalDateTime> dateTimeSupplier = () -> LocalDateTime.now();


No comments:

Post a Comment