Skip to content

Commit

Permalink
Changes to fix check-style errors and increase code coverage to 98% o…
Browse files Browse the repository at this point in the history
…verall
  • Loading branch information
barrycaceres committed Jul 25, 2024
1 parent f46cc09 commit 564b535
Show file tree
Hide file tree
Showing 43 changed files with 2,115 additions and 656 deletions.
3 changes: 3 additions & 0 deletions checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@
<suppress checks="FinalParameters" files="."/>
<suppress checks="RegexpSingleline" files="."/>
<suppress checks="AvoidStarImport" files="."/>
<suppress checks="HiddenField" files="."/>
<suppress checks="ParameterNumber" files="."/>
<suppress checks="MagicNumber" files="."/>
</suppressions>
20 changes: 10 additions & 10 deletions src/main/java/com/senzing/sdk/SzConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,16 @@ public interface SzConfig {
* The format of the JSON response is as follows:
* <pre>
* {
* "DATA_SOURCES": [
* {
* "DSRC_ID": 1,
* "DSRC_CODE": "TEST"
* },
* {
* "DSRC_ID": 2,
* "DSRC_CODE": "SEARCH"
* }
* ]
* "DATA_SOURCES": [
* {
* "DSRC_ID": 1,
* "DSRC_CODE": "TEST"
* },
* {
* "DSRC_ID": 2,
* "DSRC_CODE": "SEARCH"
* }
* ]
* }
* </pre>
*
Expand Down
152 changes: 76 additions & 76 deletions src/main/java/com/senzing/sdk/SzConfigManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,111 +4,111 @@
* Defines the Java interface to the Senzing configuration management functions.
*/
public interface SzConfigManager {
/**
* Adds the configuration described by the specified JSON to the repository
* with the specified comment and returns the identifier for referencing the
/**
* Adds the configuration described by the specified JSON to the repository
* with the specified comment and returns the identifier for referencing the
* the config in the entity repository.
*
* @param configDefinition The JSON text describing the configuration.
* @param configComment The comments for the configuration.
* @return The identifier for referncing the config in the entity repository.
*
* @param configDefinition The JSON text describing the configuration.
* @param configComment The comments for the configuration.
* @return The identifier for referncing the config in the entity repository.
*
* @throws SzException If a failure occurs.
*/
long addConfig(String configDefinition, String configComment)
*/
long addConfig(String configDefinition, String configComment)
throws SzException;

/**
* Gets the configuration with the specified config ID and returns the
/**
* Gets the configuration with the specified config ID and returns the
* configuration defintion as a {@link String}.
*
* @param configId The configuration ID of the configuration to retrieve.
*
* @param configId The configuration ID of the configuration to retrieve.
*
* @return The configuration definition as a {@link String}.
* @return The configuration definition as a {@link String}.
*
* @throws SzException If a failure occurs.
*/
String getConfig(long configId) throws SzException;
*/
String getConfig(long configId) throws SzException;

/**
* Gets the list of saved configuration ID's with their comments and
* timestamps and return the JSON {@link String} describing them. An
/**
* Gets the list of saved configuration ID's with their comments and
* timestamps and return the JSON {@link String} describing them. An
* example format for the response is:
* <pre>
* {
* "CONFIGS": [
* {
* "CONFIG_ID": 12345678912345,
* "SYS_CREATE_DT": "2021-03-25 18:35:00.743",
* "CONFIG_COMMENTS": "Added EMPLOYEES data source."
* },
* {
* "CONFIG_ID": 23456789123456,
* "SYS_CREATE_DT": "2021-02-08 23:27:09.876",
* "CONFIG_COMMENTS": "Added CUSTOMERS data source."
* },
* {
* "CONFIG_ID": 34567891234567,
* "SYS_CREATE_DT": "2021-02-08 23:27:05.212",
* "CONFIG_COMMENTS": "Initial Config"
* },
* . . .
* ]
* }
* </pre>
*
* @return The JSON {@link String} describing the configurations registered
* <pre>
* {
* "CONFIGS": [
* {
* "CONFIG_ID": 12345678912345,
* "SYS_CREATE_DT": "2021-03-25 18:35:00.743",
* "CONFIG_COMMENTS": "Added EMPLOYEES data source."
* },
* {
* "CONFIG_ID": 23456789123456,
* "SYS_CREATE_DT": "2021-02-08 23:27:09.876",
* "CONFIG_COMMENTS": "Added CUSTOMERS data source."
* },
* {
* "CONFIG_ID": 34567891234567,
* "SYS_CREATE_DT": "2021-02-08 23:27:05.212",
* "CONFIG_COMMENTS": "Initial Config"
* },
* . . .
* ]
* }
* </pre>
*
* @return The JSON {@link String} describing the configurations registered
* in the entity repository with their identifiers, timestamps and
* comments.
*
* @throws SzException If a failure occurs.
*/
String getConfigs() throws SzException;
*/
String getConfigs() throws SzException;

/**
* Gets the configuration ID of the default configuration for the repository
* and returns it. If the entity repository is in the initial state and the
/**
* Gets the configuration ID of the default configuration for the repository
* and returns it. If the entity repository is in the initial state and the
* default configuration ID has not yet been set, then zero (0) is returned.
*
* @return The current default cofiguration ID in the repository, or zero (0)
* @return The current default cofiguration ID in the repository, or zero (0)
* if the entity repository is in the initial state with no default
* configuration ID having yet been set.
*
* @throws SzException If a failure occurs.
*/
long getDefaultConfigId() throws SzException;
*/
long getDefaultConfigId() throws SzException;

/**
* Replaces the current configuration ID of the repository with the specified
* new configuration ID providing the current configuration ID of the
* repository is equal to the specified old configuration ID. If the current
* configuration ID is not the same as the specified old configuration ID then
* this method fails to replace the default configuration ID with the new
* value and an {@link SzReplaceConflictException} is thrown.
*
* @param currentDefaultConfigId The configuration ID that is believed to be the
* current default configuration ID.
/**
* Replaces the current configuration ID of the repository with the specified
* new configuration ID providing the current configuration ID of the
* repository is equal to the specified old configuration ID. If the current
* configuration ID is not the same as the specified old configuration ID then
* this method fails to replace the default configuration ID with the new
* value and an {@link SzReplaceConflictException} is thrown.
*
* @param currentDefaultConfigId The configuration ID that is believed to be the
* current default configuration ID.
*
* @param newDefaultConfigId The new configuration ID for the repository.
*
* @param newDefaultConfigId The new configuration ID for the repository.
* @throws SzReplaceConflictException If the default configuration ID was not updated
* to the specified new value because the current
* default configuration ID found in the repository
* was not equal to the specified expected current
* default configuration ID value.
*
* @throws SzReplaceConflictException If the default configuration ID was not updated
* to the specified new value because the current
* default configuration ID found in the repository
* was not equal to the specified expected current
* default configuration ID value.
*
* @throws SzException If a failure occurs.
*/
void replaceDefaultConfigId(long currentDefaultConfigId, long newDefaultConfigId)
*/
void replaceDefaultConfigId(long currentDefaultConfigId, long newDefaultConfigId)
throws SzReplaceConflictException, SzException;

/**
* Sets the default configuration for the repository to the specified
* configuration ID.
*
* @param configId The configuration ID to set as the default configuration.
* Sets the default configuration for the repository to the specified
* configuration ID.
*
* @param configId The configuration ID to set as the default configuration.
*
* @throws SzException If a failure occurs.
*/
void setDefaultConfigId(long configId) throws SzException;
*/
void setDefaultConfigId(long configId) throws SzException;
}
6 changes: 4 additions & 2 deletions src/main/java/com/senzing/sdk/SzEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -1008,8 +1008,10 @@ long exportCsvEntityReport(String csvColumnList, Set<SzFlag> flags)
* @param exportHandle The export handle to identify the export from
* which to retrieve the next line of data.
*
* @return The next line of export data whose format depends on which
* function was used to initiate the export.
* @return The next line of export data whose format depends on
* which function was used to initiate the export, or
* <code>null</code> if there is no more data to be
* exported via the specified handle.
*
* @see #exportCsvEntityReport(String, Set)
* @see #exportJsonEntityReport(Set)
Expand Down
14 changes: 10 additions & 4 deletions src/main/java/com/senzing/sdk/SzEntityIds.java
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,9 @@ public SzEntityIds(long... entityIds)
* contains <code>null</code> elements.
*/
public static SzEntityIds of(Collection<Long> entityIds) {
if (entityIds == null) return null;
if (entityIds == null) {
return null;
}
return new SzEntityIds(new TreeSet<>(entityIds));
}

Expand Down Expand Up @@ -753,7 +755,9 @@ public static SzEntityIds of(Long entityId1,
public static SzEntityIds of(Long... entityIds)
throws NullPointerException
{
if (entityIds == null) return null;
if (entityIds == null) {
return null;
}
return new SzEntityIds(entityIds);
}

Expand Down Expand Up @@ -781,7 +785,9 @@ public static SzEntityIds of(Long... entityIds)
public static SzEntityIds of(long... entityIds)
throws NullPointerException
{
if (entityIds == null) return null;
if (entityIds == null) {
return null;
}
Long[] array = new Long[entityIds.length];
for (int index = 0; index < entityIds.length; index++) {
array[index] = entityIds[index];
Expand All @@ -796,7 +802,7 @@ public static SzEntityIds of(long... entityIds)
* @return A new {@link Builder} for creating an instance of
* {@link SzEntityIds}.
*/
public static Builder builder() {
public static Builder newBuilder() {
return new Builder();
}

Expand Down
Loading

0 comments on commit 564b535

Please sign in to comment.