The role of Supplier and its use

Supplier: From the meaning of the word, it can provide (produce) a generic object instance, the source code is as follows:
insert image description here

Demo

public Flux<Apple> getApple(@PathVariable String id) {
   
    
    
    //创建Supplier容器,声明为TestSupplier类型,此时并不会调用对象的构造方法,即不会创建对象
    Supplier<

Guess you like

Origin blog.csdn.net/CSDN_SAVIOR/article/details/126380192