class NCharType extends CharType {

    @Override
    public DatabaseDataType toDatabaseDataType(Database database) {<FILL_FUNCTION_BODY>}

}

        if (database instanceof HsqlDatabase) {
            return new DatabaseDataType("CHAR", getParameters());
        }
        if (database instanceof OracleDatabase) {
            return new DatabaseDataType("NCHAR", getParameters());
        }
        if (database instanceof MSSQLDatabase) {
            Object[] parameters = getParameters();
            if (parameters.length > 0) {
                String param1 = parameters[0].toString();
                if (!param1.matches("\\d+") || (new BigInteger(param1).compareTo(BigInteger.valueOf(4000)) > 0)) {

                    DatabaseDataType type = new DatabaseDataType(database.escapeDataTypeName("nchar"), 4000);
                    type.addAdditionalInformation(getAdditionalInformation());
                    return type;
                }
            }
            if (parameters.length == 0) {
              parameters = new Object[] { 1 };
            } else if (parameters.length > 1) {
                parameters = Arrays.copyOfRange(parameters, 0, 1);
            }
            DatabaseDataType type = new DatabaseDataType(database.escapeDataTypeName("nchar"), parameters);
            type.addAdditionalInformation(getAdditionalInformation());
            return type;
        }
        return super.toDatabaseDataType(database);
    
<methods>public non-sealed void <init>() ,public liquibase.change.core.LoadDataChange.LOAD_DATA_TYPE getLoadTypeName() ,public java.lang.String objectToSql(java.lang.Object, liquibase.database.Database) ,public liquibase.datatype.DatabaseDataType toDatabaseDataType(liquibase.database.Database) <variables>