All Downloads are FREE. Search and download functionalities are using the official Maven repository.

javaslang.readme-contributing.md Maven / Gradle / Ivy

There is a newer version: 8.1.2
Show newest version
Please ensure that all major types but Functions, currently Tuples, Values and Traversables, have a `transform` method.

Example (`TYPE` is replaced by the actual type):

```java
/**
 * Transforms this {@code TYPE}.
 *
 * @param f   A transformation
 * @param  Type of transformation result
 * @return An instance of type {@code U}
 * @throws NullPointerException if {@code f} is null
 */
default  U transform(Function, ? extends U> f) {
    Objects.requireNonNull(f, "f is null");
    return f.apply(this);
}
```

See also [#716](https://github.com/javaslang/javaslang/issues/716#issuecomment-163399633).