
com.github.jparkie.promise.functions.FlatMapFunction Maven / Gradle / Ivy
The newest version!
package com.github.jparkie.promise.functions;
import com.github.jparkie.promise.Function;
import com.github.jparkie.promise.Promise;
import com.github.jparkie.promise.Promises;
public abstract class FlatMapFunction implements Function {
@Override
public Promise call(Promise promise) {
if (promise.isSuccessful()) {
return flatMap(promise.get());
} else {
return Promises.error(promise.getError());
}
}
public abstract Promise flatMap(T value);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy