[JAVA8] java.util.function 패키지
java.util.function 패키지
Java 8에 추가되었으며 람다 표현식을 보조하는 인터페이스를 모아놓은 패키지이다.
Function, Supplier, Consumer, Predicate, UnaryOperator, BinaryOperator 등의 인터페이스가 있으며,
람다 표현식으로 선언될 추상 메소드를 하나씩 가지고 있다.
- boolean test(T t)
- default Predicate<T> and(Predicate<? super T> other)
- default Predicate<T> or(Predicate<? super T> other)
- default Predicate<T> negate(Predicate<? super T> other)
- static <T> Predicate<T> isEqual(Object targetRef)
- T get()
- void Accept(T t)
- default Consumer<T> andThen(Consumer<? super T> after)
- R apply(T t)
- default <V> Function<T, V> andThen(Function <? super R, ? extends V> after)
- defualt <V> Function<V, R> compose(Function <? super V, ? extends T> before)
- static <T> Function<T, T> identity()
- Function<T, T>를 상속받은 인터페이스
- static <T> unaryOperator<T> identity()
- BiFunction<T, T, T>를 상속받은 인터페이스
- static <T> BinaryOperator<T> maxBy(Comparator<? super T> comparator)
- static <T> BinaryOperator<T> minBy(Comparator<? super T> comparator)