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.- Since:
- 4.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringcreateConfigComment(String configDefinition) Produce an auto-generated configuration comment describing a configuration.static SzExceptioncreateSzException(int errorCode, String message) Creates the appropriateSzExceptioninstance for the specified error code.
-
Method Details
-
createSzException
Creates the appropriateSzExceptioninstance for the specified error code.If there is a failure in creating the
SzExceptioninstance, then a genericSzExceptionis 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 theSzExceptioninstance.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. - Since:
- 4.0.0
-
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 JSONStringconfiguration definition.- Returns:
- The auto-generated comment, which may be empty-string if an auto-generated comment could not be inferred.
- Since:
- 4.0.0
-