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

io.github.kbachilo.jooq.converter.BigDecimalConverter Maven / Gradle / Ivy

package io.github.kbachilo.jooq.converter;

import org.jooq.Converter;

import java.math.BigDecimal;
import java.util.Objects;

public class BigDecimalConverter implements Converter {

    public BigDecimal from(Double databaseObject) {
        return Objects.isNull(databaseObject) ? null : BigDecimal.valueOf(databaseObject);
    }

    public Double to(BigDecimal userObject) {
        return Objects.isNull(userObject) ? null : userObject.doubleValue();
    }

    public Class fromType() {
        return Double.class;
    }

    public Class toType() {
        return BigDecimal.class;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy