Class SzCoreUtilities

java.lang.Object
com.senzing.sdk.core.SzCoreUtilities

public final class SzCoreUtilities extends Object
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 Details

    • createSzException

      public static SzException createSzException(int errorCode, String message)
      Creates the appropriate SzException instance for the specified error code.

      If there is a failure in creating the SzException instance, then a generic SzException 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 the SzException 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

      public static String createConfigComment(String configDefinition)
      Produce an auto-generated configuration comment describing a configuration. This is useful when implementing the SzConfigManager.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 JSON String configuration definition.
      Returns:
      The auto-generated comment, which may be empty-string if an auto-generated comment could not be inferred.