Package com.senzing.sdk.core
Class SzCoreEnvironment.Builder
java.lang.Object
com.senzing.sdk.core.SzCoreEnvironment.Builder
- Enclosing class:
- SzCoreEnvironment
The builder class for creating an instance of
SzCoreEnvironment
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
This method creates a newSzCoreEnvironment
instance based on thisSzCoreEnvironment.Builder
instance.Sets the explicit configuration ID to use to initialize theSzCoreEnvironment
.instanceName
(String instanceName) Provides the Senzing instance name to configure theSzCoreEnvironment
.Provides the Senzing settings to configure theSzCoreEnvironment
.verboseLogging
(boolean verboseLogging) Sets the verbose logging flag for configuring theSzCoreEnvironment
.
-
Constructor Details
-
Builder
public Builder()Private constructor.
-
-
Method Details
-
settings
Provides the Senzing settings to configure theSzCoreEnvironment
. If this is set tonull
or empty-string thenSzCoreEnvironment.DEFAULT_SETTINGS
will be used to provide limited funtionality.- Parameters:
settings
- The Senzing settings, ornull
or empty-string to restore the default value.- Returns:
- A reference to this instance.
- See Also:
-
instanceName
Provides the Senzing instance name to configure theSzCoreEnvironment
. Call this method to override the default value ofSzCoreEnvironment.DEFAULT_INSTANCE_NAME
.- Parameters:
instanceName
- The instance name to initialize theSzCoreEnvironment
, ornull
or empty-string to restore the default.- Returns:
- A reference to this instance.
- See Also:
-
verboseLogging
Sets the verbose logging flag for configuring theSzCoreEnvironment
. Call this method to explicitly set the value. If not called, the default value isfalse
.- Parameters:
verboseLogging
-true
if verbose logging should be enabled, otherwisefalse
.- Returns:
- A reference to this instance.
-
configId
Sets the explicit configuration ID to use to initialize theSzCoreEnvironment
. If not specified then the default configuration ID obtained from the Senzing repository is used.- Parameters:
configId
- The explicit configuration ID to use to initialize theSzCoreEnvironment
, ornull
if the default configuration ID from the Senzing repository should be used.- Returns:
- A reference to this instance.
-
build
This method creates a newSzCoreEnvironment
instance based on thisSzCoreEnvironment.Builder
instance. This method will throw anIllegalStateException
if another activeSzCoreEnvironment
instance exists since only one active instance can exist within a process at any given time. An active instance is one that has been constructed, but has not yet been destroyed.- Returns:
- The newly created
SzCoreEnvironment
instance. - Throws:
IllegalStateException
- If another activeSzCoreEnvironment
instance exists when this method is invoked.
-