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

org.itsallcode.jdbc.ParamConverter Maven / Gradle / Ivy

There is a newer version: 0.7.1
Show newest version
package org.itsallcode.jdbc;

/**
 * This converts a domain object to types supported by the database when
 * inserting rows.
 * 
 * @param  row type
 */
@FunctionalInterface
public interface ParamConverter {
    /**
     * Converts a domain object to a row that can be inserted into the database.
     * 
     * @param row domain object to convert
     * @return converted row
     */
    Object[] map(T row);

    /**
     * Identity parameter convert that returns object arrays unchanged.
     * 
     * @return a new identity parameter converter
     */
    public static ParamConverter identity() {
        return row -> row;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy