package __.org.seasar.doma.it.domain;

/** */
@javax.annotation.Generated(value = { "Doma", "1.36.0-SNAPSHOT" }, date = "2022-09-08T03:51:27.506+0900")
public final class _Age implements org.seasar.doma.jdbc.domain.DomainType<java.lang.Integer, org.seasar.doma.it.domain.Age> {

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

    private static final _Age singleton = new _Age();

    private static final org.seasar.doma.it.domain.AgeConverter converter = new org.seasar.doma.it.domain.AgeConverter();

    private _Age() {
    }

    @Override
    public org.seasar.doma.it.domain.Age newDomain(java.lang.Integer value) {
        return converter.fromValueToDomain(value);
    }

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

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

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

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

    private static class Wrapper extends org.seasar.doma.wrapper.IntegerWrapper implements org.seasar.doma.jdbc.domain.DomainWrapper<java.lang.Integer, org.seasar.doma.it.domain.Age> {

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

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

        @Override
        protected java.lang.Integer doGet() {
            if (domain == null) {
                return null;
            }
            return converter.fromDomainToValue(domain);
        }

        @Override
        protected void doSet(java.lang.Integer value) {
            domain = converter.fromValueToDomain(value);
        }

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