com.amazonaws.codegen.utils

## Class FunctionalUtils

- java.lang.Object
- - com.amazonaws.codegen.utils.FunctionalUtils

    public class FunctionalUtils
    extends Object

### Nested Class Summary

Nested Classes
`static interface` `FunctionalUtils.ExceptionThrowingFunction<T,R>` Equivalent of `Function` that throws a checked exception.

### Constructor Summary

Constructors
Constructor and Description
`FunctionalUtils()`

### Method Summary

All Methods Static Methods Concrete Methods
`static <T,R> java.util.function.Function<T,R>` `safeFunction(FunctionalUtils.ExceptionThrowingFunction<T,R> unsafeFunc)` Takes a functional interface that throws an exception and returns a `Function` that deals with that exception by wrapping in a runtime exception.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### FunctionalUtils

    public FunctionalUtils()

### Method Detail

#### safeFunction

    public static <T,R> java.util.function.Function<T,R> safeFunction(FunctionalUtils.ExceptionThrowingFunction<T,R> unsafeFunc)

Takes a functional interface that throws an exception and returns a `Function` that deals with that exception by wrapping in a runtime exception. Useful for APIs that use the standard Java functional interfaces that don't throw checked exceptions.

Type Parameters:
  `T` - Input
  `R` - Output
Parameters:
  `unsafeFunc` - Functional interface that throws checked exception.
Returns:
  New `Function` that handles checked exception.