# 函數式接口
## Java8 函數式接口一覽
~~~
// Function<T, R> -T作為輸入,返回的R作為輸出
Function<String,String> fun = (x) -> {System.out.print(x+": ");return "Function";};
System.out.println(function.apply("hello world"));
//Predicate<T> -T作為輸入,返回的boolean值作為輸出
Predicate<String> pre = (x) ->{System.out.print(x);return false;};
System.out.println(": "+pre.test("hello World"));
//Consumer<T> - T作為輸入,執行某種動作但沒有返回值
Consumer<String> con = (x) -> {System.out.println(x);};
con.accept("hello world");
//Supplier<T> - 沒有任何輸入,返回T
Supplier<String> supp = () -> {return "Supplier";};
System.out.println(supp.get());
//BinaryOperator<T> -兩個T作為輸入,返回一個T作為輸出,對于“reduce”操作很有用
BinaryOperator<String> bina = (x,y) ->{System.out.print(x+" "+y);return "BinaryOperator";};
System.out.println(" "+bina.apply("hello ","world"));
~~~
## 自定義函數式
~~~
@FunctionalInterface
~~~
- 序
- 快速開始
- 環境要求
- 環境準備
- 工程導入
- 工程運行
- 技術基礎
- Java8
- Lambda
- Lambda 受檢異常處理
- Stream 簡介
- Stream API 一覽
- Stream API(上)
- Stream API(下)
- Optional 干掉空指針
- 函數式接口
- 新的日期 API
- Lombok
- SpringMVC
- Swagger
- Mybaties
- Mybaties-plus
- 開發初探
- 新建微服務工程
- 第一個API
- API鑒權
- API響應結果
- Redis 緩存
- 第一個CRUD
- 建表
- 建Entity
- 建Service和Mapper
- 新增API
- 修改API
- 刪除API
- 查詢API
- 單條查詢
- 多條查詢
- 分頁
- 微服務遠程調用
- 聲明式服務調用Feign
- 熔斷機制 Hystrix
- 開發進階