Skip to content

Commit d598452

Browse files
committed
Using simpler lens type signature in MapLens#values; weakening constraint in CheckedSupplier to Throwable
1 parent bb15b6e commit d598452

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/java/com/jnape/palatable/lambda/functions/specialized/checked/CheckedSupplier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* @see CheckedFn1
1313
*/
1414
@FunctionalInterface
15-
public interface CheckedSupplier<E extends Exception, T> extends Supplier<T> {
15+
public interface CheckedSupplier<E extends Throwable, T> extends Supplier<T> {
1616

1717
@Override
1818
default T get() {

src/main/java/com/jnape/palatable/lambda/lens/lenses/MapLens.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ public static <K, V> Lens.Simple<Map<K, V>, Set<K>> keys() {
9191
* @param <V> the value type
9292
* @return a lens that focuses on the values of a map
9393
*/
94-
public static <K, V> Lens<Map<K, V>, Map<K, V>, Collection<V>, Collection<V>> values() {
95-
return lens(Map::values, (m, vs) -> {
94+
public static <K, V> Lens.Simple<Map<K, V>, Collection<V>> values() {
95+
return simpleLens(Map::values, (m, vs) -> {
9696
Set<V> valueSet = new HashSet<>(vs);
9797
Set<K> matchingKeys = m.entrySet().stream()
9898
.filter(kv -> valueSet.contains(kv.getValue()))

0 commit comments

Comments
 (0)