Interface ConsumerX<T>
- Type Parameters:
T- 参数类型
- All Superinterfaces:
Consumer<T>,Serializable
- All Known Implementing Classes:
FileTailer.ConsoleLineHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
可序列化的Consumer
- Since:
- Java 17+
- Author:
- Kimi Liu
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidPerforms this operation on the given argument.voidPerforms this operation on the given argument.Returns a composedConsumerthat performs, in sequence, this operation followed by theafteroperation.static <T> ConsumerX<T> multistatic <T> ConsumerX<T> nothing()nothing
-
Method Details
-
multi
multi- Type Parameters:
T- type- Parameters:
consumers- lambda- Returns:
- lambda
-
nothing
nothing- Type Parameters:
T- type- Returns:
- nothing
-
accepting
Performs this operation on the given argument. -
accept
Performs this operation on the given argument. -
andThen
Returns a composedConsumerthat performs, in sequence, this operation followed by theafteroperation. If performing either operation throws an exception, it is relayed to the caller of the composed operation. If performing this operation throws an exception, theafteroperation will not be performed.- Parameters:
after- the operation to perform after this operation- Returns:
- a composed
Consumerthat performs in sequence this operation followed by theafteroperation - Throws:
NullPointerException- ifafteris null
-