Package com.senzing.sdk.core
Class SzCoreEnvironment.AbstractBuilder<E extends SzCoreEnvironment,B extends SzCoreEnvironment.AbstractBuilder<E,B>>
java.lang.Object
com.senzing.sdk.core.SzCoreEnvironment.AbstractBuilder<E,B>
- Type Parameters:
E- TheSzCoreEnvironment-derived class built by instances of this class.B- TheSzCoreEnvironment.AbstractBuilder-derived class of the implementation.
- All Implemented Interfaces:
SzCoreEnvironment.Initializer
- Direct Known Subclasses:
SzCoreEnvironment.Builder
- Enclosing class:
SzCoreEnvironment
public abstract static class SzCoreEnvironment.AbstractBuilder<E extends SzCoreEnvironment,B extends SzCoreEnvironment.AbstractBuilder<E,B>>
extends Object
implements SzCoreEnvironment.Initializer
Provides a base class for builder implementations of
SzCoreEnvironment and its derived classes.
This class is not used in the usage of SzCoreEnvironment.
It is only needed if you are extending SzCoreEnvironment.
This class allows the derived builder to return references to its
own environment class and to its own builder type rather than base
classes. When extending SzCoreEnvironment you should
provide an implementation of this class that is specific to your
derived class.
- Since:
- 4.1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Ebuild()Implement this method to create a newSzCoreEnvironmentinstance of typeEbased on this builder instance.Sets the explicit configuration ID to use to initialize theSzCoreEnvironment.Gets the explicit configuration ID (if any) with which to initialize theSzCoreEnvironment.Gets the Senzing instance name with which to initialize theSzCoreEnvironment.Gets the Senzing settings with which to initialize theSzCoreEnvironment.instanceName(String instanceName) Provides the Senzing instance name to initialize theSzCoreEnvironment.booleanChecks if configuring theSzCoreEnvironmentwith verbose logging.Provides the Senzing settings to initialize theSzCoreEnvironment.verboseLogging(boolean verboseLogging) Sets the verbose logging flag for initializing theSzCoreEnvironment.
-
Constructor Details
-
AbstractBuilder
protected AbstractBuilder()Default constructor.- Since:
- 4.1.0
-
-
Method Details
-
settings
Provides the Senzing settings to initialize theSzCoreEnvironment. If this is set tonullor empty-string thenSzCoreEnvironment.DEFAULT_SETTINGSwill be used to provide limited functionality.- Parameters:
settings- The Senzing settings, ornullor empty-string to restore the default value.- Returns:
- A reference to this instance.
- Since:
- 4.1.0 (4.0.0 as part of
SzCoreEnvironment.Builder) - See Also:
-
getSettings
Gets the Senzing settings with which to initialize theSzCoreEnvironment.- Specified by:
getSettingsin interfaceSzCoreEnvironment.Initializer- Returns:
- The Senzing settings with which to configure
the
SzCoreEnvironment. - Since:
- 4.1.0
-
instanceName
Provides the Senzing instance name to initialize theSzCoreEnvironment. Call this method to override the default value ofSzCoreEnvironment.DEFAULT_INSTANCE_NAME.- Parameters:
instanceName- The instance name to initialize theSzCoreEnvironment, ornullor empty-string to restore the default.- Returns:
- A reference to this instance.
- Since:
- 4.1.0 (4.0.0 as part of
SzCoreEnvironment.Builder) - See Also:
-
getInstanceName
Gets the Senzing instance name with which to initialize theSzCoreEnvironment.- Specified by:
getInstanceNamein interfaceSzCoreEnvironment.Initializer- Returns:
- The Senzing instance name with which to initialize
the
SzCoreEnvironment. - Since:
- 4.1.0
-
verboseLogging
Sets the verbose logging flag for initializing theSzCoreEnvironment. Call this method to explicitly set the value. If not called, the default value isfalse.- Parameters:
verboseLogging-trueif verbose logging should be enabled, otherwisefalse.- Returns:
- A reference to this instance.
- Since:
- 4.1.0 (4.0.0 as part of
SzCoreEnvironment.Builder)
-
isVerboseLogging
public boolean isVerboseLogging()Checks if configuring theSzCoreEnvironmentwith verbose logging.- Specified by:
isVerboseLoggingin interfaceSzCoreEnvironment.Initializer- Returns:
trueif verbose logging will be enabled, otherwisefalse.- Since:
- 4.1.0
-
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, ornullif the default configuration ID from the Senzing repository should be used.- Returns:
- A reference to this instance.
- Since:
- 4.1.0 (4.0.0 as part of
SzCoreEnvironment.Builder)
-
getConfigId
Gets the explicit configuration ID (if any) with which to initialize theSzCoreEnvironment. This returnsnullif no explicit configuration ID has been provided and the default configuration ID from the Senzing repository should be used.- Specified by:
getConfigIdin interfaceSzCoreEnvironment.Initializer- Returns:
- The explicit configuration ID with which to initialize the
SzCoreEnvironment, ornullif none and the default configuration ID from the Senzing repository should be used. - Since:
- 4.1.0
-
build
Implement this method to create a newSzCoreEnvironmentinstance of typeEbased on this builder instance. This method will throw anIllegalStateExceptionif another activeSzCoreEnvironmentinstance 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
SzCoreEnvironmentinstance of typeE. - Throws:
IllegalStateException- If another activeSzCoreEnvironmentinstance exists when this method is invoked.- Since:
- 4.1.0
-