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

com.oembedler.moon.graphql.boot.error.Throwables Maven / Gradle / Ivy

There is a newer version: 5.6.1
Show newest version
package com.oembedler.moon.graphql.boot.error;

import java.util.Arrays;
import java.util.List;
import java.util.Optional;

class Throwables {

    private List> throwables;

    Throwables(Class[] throwables) {
        this.throwables = Arrays.asList(throwables);
    }

    Optional> mostConcrete(Throwable throwable) {
        return throwables.stream()
                .filter(t -> t.isAssignableFrom(throwable.getClass()))
                .min(new ThrowableComparator());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy