@Test void toProductUnknown() { DatabaseProduct product = DatabaseProduct.toProduct("whatever"); assertSame(DatabaseProduct.UNKNOWN, product); }
public static DatabaseProduct toProduct(String productNameOrJDBCScheme) { DatabaseProduct product; if (matches(productNameOrJDBCScheme, ORACLE)) { product = ORACLE; } else if (matches(productNameOrJDBCScheme, DERBY)) { product = DERBY; } else if (matches(productNameOrJDBCScheme, HSQLDB)) { product = HSQLDB; } else if (matches(productNameOrJDBCScheme, H2)) { product = H2; } else if (productNameOrJDBCScheme.startsWith(DB2.getProductName()) || DB2.jdbcScheme.equalsIgnoreCase(productNameOrJDBCScheme)) { product = DB2; } else if (isMySQL(productNameOrJDBCScheme)) { product = MYSQL; } else if (matches(productNameOrJDBCScheme, POSTGRESQL)) { product = POSTGRESQL; } else if (matches(productNameOrJDBCScheme, MSSQL)) { product = MSSQL; } else { product = UNKNOWN; } return product; }
DatabaseProduct { public static DatabaseProduct toProduct(String productNameOrJDBCScheme) { DatabaseProduct product; if (matches(productNameOrJDBCScheme, ORACLE)) { product = ORACLE; } else if (matches(productNameOrJDBCScheme, DERBY)) { product = DERBY; } else if (matches(productNameOrJDBCScheme, HSQLDB)) { product = HSQLDB; } else if (matches(productNameOrJDBCScheme, H2)) { product = H2; } else if (productNameOrJDBCScheme.startsWith(DB2.getProductName()) || DB2.jdbcScheme.equalsIgnoreCase(productNameOrJDBCScheme)) { product = DB2; } else if (isMySQL(productNameOrJDBCScheme)) { product = MYSQL; } else if (matches(productNameOrJDBCScheme, POSTGRESQL)) { product = POSTGRESQL; } else if (matches(productNameOrJDBCScheme, MSSQL)) { product = MSSQL; } else { product = UNKNOWN; } return product; } }
DatabaseProduct { public static DatabaseProduct toProduct(String productNameOrJDBCScheme) { DatabaseProduct product; if (matches(productNameOrJDBCScheme, ORACLE)) { product = ORACLE; } else if (matches(productNameOrJDBCScheme, DERBY)) { product = DERBY; } else if (matches(productNameOrJDBCScheme, HSQLDB)) { product = HSQLDB; } else if (matches(productNameOrJDBCScheme, H2)) { product = H2; } else if (productNameOrJDBCScheme.startsWith(DB2.getProductName()) || DB2.jdbcScheme.equalsIgnoreCase(productNameOrJDBCScheme)) { product = DB2; } else if (isMySQL(productNameOrJDBCScheme)) { product = MYSQL; } else if (matches(productNameOrJDBCScheme, POSTGRESQL)) { product = POSTGRESQL; } else if (matches(productNameOrJDBCScheme, MSSQL)) { product = MSSQL; } else { product = UNKNOWN; } return product; } private  DatabaseProduct(String productName, String jdbcScheme); }
DatabaseProduct { public static DatabaseProduct toProduct(String productNameOrJDBCScheme) { DatabaseProduct product; if (matches(productNameOrJDBCScheme, ORACLE)) { product = ORACLE; } else if (matches(productNameOrJDBCScheme, DERBY)) { product = DERBY; } else if (matches(productNameOrJDBCScheme, HSQLDB)) { product = HSQLDB; } else if (matches(productNameOrJDBCScheme, H2)) { product = H2; } else if (productNameOrJDBCScheme.startsWith(DB2.getProductName()) || DB2.jdbcScheme.equalsIgnoreCase(productNameOrJDBCScheme)) { product = DB2; } else if (isMySQL(productNameOrJDBCScheme)) { product = MYSQL; } else if (matches(productNameOrJDBCScheme, POSTGRESQL)) { product = POSTGRESQL; } else if (matches(productNameOrJDBCScheme, MSSQL)) { product = MSSQL; } else { product = UNKNOWN; } return product; } private  DatabaseProduct(String productName, String jdbcScheme); String getProductName(); @Override boolean equals(Object object); static DatabaseProduct toProduct(String productNameOrJDBCScheme); @Override int hashCode(); @Override String toString(); }
DatabaseProduct { public static DatabaseProduct toProduct(String productNameOrJDBCScheme) { DatabaseProduct product; if (matches(productNameOrJDBCScheme, ORACLE)) { product = ORACLE; } else if (matches(productNameOrJDBCScheme, DERBY)) { product = DERBY; } else if (matches(productNameOrJDBCScheme, HSQLDB)) { product = HSQLDB; } else if (matches(productNameOrJDBCScheme, H2)) { product = H2; } else if (productNameOrJDBCScheme.startsWith(DB2.getProductName()) || DB2.jdbcScheme.equalsIgnoreCase(productNameOrJDBCScheme)) { product = DB2; } else if (isMySQL(productNameOrJDBCScheme)) { product = MYSQL; } else if (matches(productNameOrJDBCScheme, POSTGRESQL)) { product = POSTGRESQL; } else if (matches(productNameOrJDBCScheme, MSSQL)) { product = MSSQL; } else { product = UNKNOWN; } return product; } private  DatabaseProduct(String productName, String jdbcScheme); String getProductName(); @Override boolean equals(Object object); static DatabaseProduct toProduct(String productNameOrJDBCScheme); @Override int hashCode(); @Override String toString(); static final DatabaseProduct ORACLE; static final DatabaseProduct DERBY; static final DatabaseProduct HSQLDB; static final DatabaseProduct DB2; static final DatabaseProduct MYSQL; static final DatabaseProduct POSTGRESQL; static final DatabaseProduct MSSQL; static final DatabaseProduct H2; static final DatabaseProduct UNKNOWN; }