package org.seasar.doma.it.domain;

/** */
@javax.annotation.Generated(value = { "Doma", "1.36.0-SNAPSHOT" }, date = "2022-09-08T03:50:53.721+0900")
public final class _Salary implements org.seasar.doma.jdbc.domain.DomainType<java.math.BigDecimal, org.seasar.doma.it.domain.Salary> {

    static {
        org.seasar.doma.internal.Artifact.validateVersion("1.36.0-SNAPSHOT");
    }

    private static final _Salary singleton = new _Salary();

    private _Salary() {
    }

    @Override
    public org.seasar.doma.it.domain.Salary newDomain(java.math.BigDecimal value) {
        return new org.seasar.doma.it.domain.Salary(value);
    }

    @Override
    public Class<java.math.BigDecimal> getValueClass() {
        return java.math.BigDecimal.class;
    }

    @Override
    public Class<org.seasar.doma.it.domain.Salary> getDomainClass() {
        return org.seasar.doma.it.domain.Salary.class;
    }

    @Override
    public org.seasar.doma.jdbc.domain.DomainWrapper<java.math.BigDecimal, org.seasar.doma.it.domain.Salary> getWrapper(org.seasar.doma.it.domain.Salary domain) {
        return new Wrapper(domain);
    }

    /**
     * @return the singleton
     */
    public static _Salary getSingletonInternal() {
        return singleton;
    }

    private static class Wrapper extends org.seasar.doma.wrapper.BigDecimalWrapper implements org.seasar.doma.jdbc.domain.DomainWrapper<java.math.BigDecimal, org.seasar.doma.it.domain.Salary> {

        private org.seasar.doma.it.domain.Salary domain;

        private Wrapper(org.seasar.doma.it.domain.Salary domain) {
            this.domain = domain;
        }

        @Override
        protected java.math.BigDecimal doGet() {
            if (domain == null) {
                return null;
            }
            return domain.getValue();
        }

        @Override
        protected void doSet(java.math.BigDecimal value) {
            domain = new org.seasar.doma.it.domain.Salary(value);
        }

        @Override
        public org.seasar.doma.it.domain.Salary getDomain() {
            return domain;
        }
    }
}
