Skip to content
This repository has been archived by the owner on Feb 10, 2021. It is now read-only.

Commit

Permalink
Complete new tasks in CrazyLambdas.java
Browse files Browse the repository at this point in the history
  • Loading branch information
tboychuk committed Jul 1, 2019
1 parent 9e7c40e commit 3d8c9c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crazy-lambdas/src/main/java/com/bobocode/CrazyLambdas.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static Predicate<String> isEmptyPredicate() {
* @return function that repeats Strings
*/
public static BiFunction<String, Integer, String> stringMultiplier() {
throw new UnsupportedOperationException("It's your job to implement this method"); // todo
return String::repeat;
}

/**
Expand Down Expand Up @@ -120,7 +120,7 @@ public static Supplier<IntUnaryOperator> nMultiplyFunctionSupplier(int n) {
* @return function that composes functions with trim() function
*/
public static UnaryOperator<Function<String, String>> composeWithTrimFunction() {
throw new UnsupportedOperationException("It's your job to implement this method"); // todo
return stringFunction -> stringFunction.compose(String::trim);
}

/**
Expand Down Expand Up @@ -182,7 +182,7 @@ public static BiFunction<IntUnaryOperator, IntPredicate, IntUnaryOperator> funct
* @return a high-order function that fetches a function from a function map by a given name or returns identity()
*/
public static BiFunction<Map<String, IntUnaryOperator>, String, IntUnaryOperator> functionLoader() {
throw new UnsupportedOperationException("It's your job to implement this method"); // todo
return (functionMap, functionName) -> functionMap.getOrDefault(functionName, IntUnaryOperator.identity());
}

/**
Expand Down

0 comments on commit 3d8c9c9

Please sign in to comment.