Polish
This commit is contained in:
parent
f87b2478d5
commit
19d3007806
|
|
@ -99,12 +99,10 @@ public enum EmbeddedDatabaseConnection {
|
|||
*/
|
||||
public static boolean isEmbedded(ConnectionFactory connectionFactory) {
|
||||
OptionsCapableConnectionFactory optionsCapable = OptionsCapableConnectionFactory.unwrapFrom(connectionFactory);
|
||||
if (optionsCapable == null) {
|
||||
throw new IllegalArgumentException(
|
||||
"Cannot determine database's type as ConnectionFactory is not options-capable. To be "
|
||||
+ "options-capable, a ConnectionFactory should be created with "
|
||||
+ ConnectionFactoryBuilder.class.getName());
|
||||
}
|
||||
Assert.notNull(optionsCapable,
|
||||
() -> "Cannot determine database's type as ConnectionFactory is not options-capable. To be "
|
||||
+ "options-capable, a ConnectionFactory should be created with "
|
||||
+ ConnectionFactoryBuilder.class.getName());
|
||||
ConnectionFactoryOptions options = optionsCapable.getOptions();
|
||||
for (EmbeddedDatabaseConnection candidate : values()) {
|
||||
if (candidate.embedded.test(options)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue