UnaryOperator继承Function,同样是JDK1.8中的新特性。功能就是:对数据进行操作,生成一个与同类型对象。
方法只有一个static UnaryOperator identity(),该方法返回一个UnaryOerator对象,并且apply()方法中直接返回范型对象。
static <T> UnaryOperator<T> identity() {
return new UnaryOperator
UnaryOperator继承Function,同样是JDK1.8中的新特性。功能就是:对数据进行操作,生成一个与同类型对象。
方法只有一个static UnaryOperator identity(),该方法返回一个UnaryOerator对象,并且apply()方法中直接返回范型对象。
static <T> UnaryOperator<T> identity() {
return new UnaryOperator