Class DatabaseManager.Builder<T>
java.lang.Object
de.softwareforge.testing.postgres.embedded.DatabaseManager.Builder<T>
- Type Parameters:
- T- Object to create.
- Direct Known Subclasses:
- DatabaseManager.DatabaseManagerBuilder,- EmbeddedPgExtension.EmbeddedPgExtensionBuilder
- Enclosing class:
- DatabaseManager
Builder template.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected ImmutableSet.Builder<EmbeddedPostgresPreparer<DataSource>>protected final boolean
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionabstract Tbuild()Creates a new instance.withCustomizer(EmbeddedPostgres.BuilderCustomizer customizer) Deprecated.withDatabasePreparer(EmbeddedPostgresPreparer<DataSource> databasePreparer) Add a preparer for the template database.withDatabasePreparers(Set<EmbeddedPostgresPreparer<DataSource>> databasePreparers) Add preparers for the template database.withInstancePreparer(EmbeddedPostgresPreparer<EmbeddedPostgres.Builder> instancePreparer) Add a preparer for theEmbeddedPostgres.Builderobject.withInstancePreparers(Set<EmbeddedPostgresPreparer<EmbeddedPostgres.Builder>> instancePreparers) Add preparers for theEmbeddedPostgres.Builderobject.withPreparer(DatabasePreparer databasePreparer) Deprecated.
- 
Field Details- 
databasePreparers
- 
instancePreparers
- 
multiMode
 
- 
- 
Constructor Details- 
BuilderCreates a new builder.- Parameters:
- multiMode- True if the resulting object should be in multi mode (create multiple database instances) or single mode (use only one instance).
 
 
- 
- 
Method Details- 
withPreparer@Deprecated @NonNull public DatabaseManager.Builder<T> withPreparer(@NonNull DatabasePreparer databasePreparer) Deprecated.
- 
withDatabasePreparer@NonNull public DatabaseManager.Builder<T> withDatabasePreparer(@NonNull EmbeddedPostgresPreparer<DataSource> databasePreparer) Add a preparer for the template database. Each preparer is called once when the database manager starts to prepare the template database. This can be used to create tables, sequences etc. or preload the databases with information. In multi database mode, the template database is used and each created database will have this information cloned.- Parameters:
- databasePreparer- A- EmbeddedPostgresPreparer<DataSource>instance. Must not be null.
- Returns:
- This object instance.
- Since:
- 3.0
 
- 
withDatabasePreparers@NonNull public DatabaseManager.Builder<T> withDatabasePreparers(@NonNull Set<EmbeddedPostgresPreparer<DataSource>> databasePreparers) Add preparers for the template database. Each preparer is called once when the database manager starts to prepare the template database. This can be used to create tables, sequences etc. or preload the databases with information. In multi database mode, the template database is used and each created database will have this information cloned.- Parameters:
- databasePreparers- A set of- EmbeddedPostgresPreparer<DataSource>instances. Must not be null.
- Returns:
- This object instance.
- Since:
- 3.0
 
- 
withInstancePreparer@NonNull public DatabaseManager.Builder<T> withInstancePreparer(@NonNull EmbeddedPostgresPreparer<EmbeddedPostgres.Builder> instancePreparer) Add a preparer for theEmbeddedPostgres.Builderobject. Each preparer is called once when theEmbeddedPostgresinstance that manages the server is created.- Parameters:
- instancePreparer- A- EmbeddedPostgresPreparer<EmbeddedPostgres.Builder>instance. Must not be null.
- Returns:
- This object instance.
- Since:
- 3.0
 
- 
withInstancePreparers@NonNull public DatabaseManager.Builder<T> withInstancePreparers(@NonNull Set<EmbeddedPostgresPreparer<EmbeddedPostgres.Builder>> instancePreparers) Add preparers for theEmbeddedPostgres.Builderobject. Each preparer is called once when theEmbeddedPostgresinstance that manages the server is created.- Parameters:
- instancePreparers- A set of- EmbeddedPostgresPreparer<EmbeddedPostgres.Builder>instances. Must not be null.
- Returns:
- This object instance.
- Since:
- 3.0
 
- 
withCustomizer@Deprecated @NonNull public DatabaseManager.Builder<T> withCustomizer(@NonNull EmbeddedPostgres.BuilderCustomizer customizer) Deprecated.
- 
buildCreates a new instance.- Returns:
- The instance to create.
 
 
- 
withInstancePreparer(EmbeddedPostgresPreparer).