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

com.aerospike.jdbc.sql.SimpleWrapper Maven / Gradle / Ivy

The newest version!
package com.aerospike.jdbc.sql;

import java.sql.SQLException;
import java.sql.Wrapper;

public interface SimpleWrapper extends Wrapper {

    @Override
    default  T unwrap(Class iface) throws SQLException {
        try {
            // This works for classes that aren't actually wrapping anything
            return iface.cast(this);
        } catch (ClassCastException e) {
            throw new SQLException("Cannot unwrap " + iface, e);
        }
    }

    @Override
    default boolean isWrapperFor(Class iface) {
        // This works for classes that aren't actually wrapping anything
        return iface.isInstance(this);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy