Package com.senzing.sdk.core
Class SzCoreUtilities
java.lang.Object
com.senzing.sdk.core.SzCoreUtilities
Provides utility functions that are useful when implementing
the Senzing SDK interfaces from the
com.senzing.sdk
package. This is functionality leveraged by the "core" implementation
that is made visible to aid in other implementations.
None of the functionality provided here is required to use the
SzCoreEnvironment
class, but may be useful if creating an
alternate implementation of SzEnvironment
.-
Method Summary
Modifier and TypeMethodDescriptionstatic String
createConfigComment
(String configDefinition) Produce an auto-generated configuration comment describing a configuration.static SzException
createSzException
(int errorCode, String message) Creates the appropriateSzException
instance for the specified error code.
-
Method Details
-
createSzException
Creates the appropriateSzException
instance for the specified error code.If there is a failure in creating the
SzException
instance, then a genericSzException
is created with the specified parameters and "caused by" exception describing the failure.- Parameters:
errorCode
- The error code to use to determine the specific type for theSzException
instance.message
- The error message to associate with the exception.- Returns:
- A new instance of
SzException
(or one of its derived classes) for the specified error code and message.
-
createConfigComment
Produce an auto-generated configuration comment describing a configuration. This is useful when implementing theSzConfigManager.registerConfig(String)
function.This function will not fail on an invalid configuration, but rather will simply return an empty-string for the comment.
- Parameters:
configDefinition
- The JSONString
configuration definition.- Returns:
- The auto-generated comment, which may be empty-string if an auto-generated comment could not be inferred.
-