-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #147 from bejibx/master
Add Optional#mapToBoolean(ToBooleanFunction) method
- Loading branch information
Showing
3 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
stream/src/main/java/com/annimon/stream/function/ToBooleanFunction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.annimon.stream.function; | ||
|
||
/** | ||
* Represents a function which produces an {@code boolean}-valued result from input argument. | ||
* | ||
* @param <T> the type of the input of the function | ||
* @see Function | ||
*/ | ||
public interface ToBooleanFunction<T> { | ||
|
||
/** | ||
* Applies this function to the given argument. | ||
* | ||
* @param t an argument | ||
* @return the function result | ||
*/ | ||
boolean applyAsBoolean(T t); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters