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 E
build()
Implement this method to create a newSzCoreEnvironment
instance of typeE
based 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
.boolean
Checks if configuring theSzCoreEnvironment
with 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 tonull
or empty-string thenSzCoreEnvironment.DEFAULT_SETTINGS
will be used to provide limited functionality.- Parameters:
settings
- The Senzing settings, ornull
or 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:
getSettings
in 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
, ornull
or 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:
getInstanceName
in 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
-true
if 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 theSzCoreEnvironment
with verbose logging.- Specified by:
isVerboseLogging
in interfaceSzCoreEnvironment.Initializer
- Returns:
true
if 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
, ornull
if 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 returnsnull
if no explicit configuration ID has been provided and the default configuration ID from the Senzing repository should be used.- Specified by:
getConfigId
in interfaceSzCoreEnvironment.Initializer
- Returns:
- The explicit configuration ID with which to initialize the
SzCoreEnvironment
, ornull
if none and the default configuration ID from the Senzing repository should be used. - Since:
- 4.1.0
-
build
Implement this method to create a newSzCoreEnvironment
instance of typeE
based on this 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 of typeE
. - Throws:
IllegalStateException
- If another activeSzCoreEnvironment
instance exists when this method is invoked.- Since:
- 4.1.0
-