Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Multimap methods? #1551

Closed
danieldietrich opened this issue Sep 1, 2016 · 1 comment
Closed

Missing Multimap methods? #1551

danieldietrich opened this issue Sep 1, 2016 · 1 comment

Comments

@danieldietrich
Copy link
Contributor

Map has these, Multimap not:

<U extends V> Map<K, V> put(K key, U value, BiFunction<? super V, ? super U, ? extends V> merge);

<U extends V> Map<K, V> put(Tuple2<? extends K, U> entry, BiFunction<? super V, ? super U, ? extends V> merge);

default Function1<K, Option<V>> lift() {
    return this::get;
}

default Function1<K, V> withDefault(Function<? super K, ? extends V> defaultFunction) {
    return k -> get(k).getOrElse(() -> defaultFunction.apply(k));
}

default Function1<K, V> withDefaultValue(V defaultValue) {
    return k -> get(k).getOrElse(defaultValue);
}
@danieldietrich danieldietrich modified the milestones: 2.1.0, 2.2.0 Sep 1, 2016
@danieldietrich danieldietrich modified the milestones: 2.1.0, 2.2.0 Oct 23, 2016
@danieldietrich danieldietrich modified the milestones: vavr-1.0.0, vavr-0.9.0 Apr 20, 2017
@danieldietrich danieldietrich modified the milestones: vavr-1.0.0, vavr-1.1.0 Nov 26, 2017
@danieldietrich
Copy link
Contributor Author

Multimap will probably not part of Vavr 1. We want to focus on the most frequently used collections. Maybe we will release some kind of add-on collections package later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant