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

tech.ydb.yoj.databind.schema.BindingException Maven / Gradle / Ivy

Go to download

Core data-binding logic used by YOJ (YDB ORM for Java) to convert between Java objects and database rows (or anything representable by a Java Map, really).

The newest version!
package tech.ydb.yoj.databind.schema;

import lombok.NonNull;

import javax.annotation.Nullable;
import java.lang.reflect.InvocationTargetException;
import java.util.function.Function;

public abstract class BindingException extends IllegalArgumentException {
    protected BindingException(@Nullable Throwable cause, @NonNull Function msgFunc) {
        super(msgFunc.apply(rootCause(cause)), rootCause(cause));
    }

    private static Throwable rootCause(Throwable cause) {
        return cause instanceof InvocationTargetException ? cause.getCause() : cause;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy