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

/**
 * @param <T> T
 */
@javax.annotation.Generated(value = { "Doma", "1.36.0-SNAPSHOT" }, date = "2022-09-08T03:50:33.480+0900")
public final class _Location<T> implements org.seasar.doma.jdbc.domain.DomainType<java.lang.String, org.seasar.doma.it.domain.Location<T>> {

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

    @SuppressWarnings("rawtypes")
    private static final _Location singleton = new _Location();

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

    private _Location() {
    }

    @SuppressWarnings("unchecked")
    @Override
    public org.seasar.doma.it.domain.Location<T> newDomain(java.lang.String value) {
        return (org.seasar.doma.it.domain.Location<T>) converter.fromValueToDomain(value);
    }

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

    @SuppressWarnings("unchecked")
    @Override
    public Class<org.seasar.doma.it.domain.Location<T>> getDomainClass() {
        Class<?> clazz = org.seasar.doma.it.domain.Location.class;
        return (Class<org.seasar.doma.it.domain.Location<T>>) clazz;
    }

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

    /**
     * @return the singleton
     */
    @SuppressWarnings("unchecked")
    public static <T> _Location<T> getSingletonInternal() {
        return (_Location<T>) singleton;
    }

    private static class Wrapper<T> extends org.seasar.doma.wrapper.StringWrapper implements org.seasar.doma.jdbc.domain.DomainWrapper<java.lang.String, org.seasar.doma.it.domain.Location<T>> {

        private org.seasar.doma.it.domain.Location<T> domain;

        private Wrapper(org.seasar.doma.it.domain.Location<T> domain) {
            this.domain = domain;
        }

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

        @SuppressWarnings("unchecked")
        @Override
        protected void doSet(java.lang.String value) {
            domain = (org.seasar.doma.it.domain.Location<T>) converter.fromValueToDomain(value);
        }

        @Override
        public org.seasar.doma.it.domain.Location<T> getDomain() {
            return domain;
        }
    }
}
