Skip to content

Commit

Permalink
Use consistent return type
Browse files Browse the repository at this point in the history
  • Loading branch information
salander85 committed Oct 9, 2023
1 parent 089bab0 commit 092e389
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import java.time.ZonedDateTime;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;

Expand All @@ -21,11 +20,11 @@ public interface CustomObjectService {
* @param syncModuleName the name of the resource being synced. E.g. productSync, categorySync,
* etc..
* @param runnerName the name of this specific running sync instance defined by the user.
* @return a {@link CompletionStage} containing the current CTP timestamp as {@link
* @return a {@link CompletableFuture} containing the current CTP timestamp as {@link
* ZonedDateTime}.
*/
@Nonnull
CompletionStage<ZonedDateTime> getCurrentCtpTimestamp(
CompletableFuture<ZonedDateTime> getCurrentCtpTimestamp(
@Nullable final String runnerName, @Nonnull final String syncModuleName);

/**
Expand All @@ -39,10 +38,10 @@ CompletionStage<ZonedDateTime> getCurrentCtpTimestamp(
* @param runnerName the name of this specific running sync instance defined by the user.
* @return the custom object with container 'commercetools-project-sync.{@param
* runnerName}.{@param syncModuleName}' and key '{@param sourceProjectKey}', wrapped in an {@link Optional} as a
* result of a {@link CompletionStage}.
* result of a {@link CompletableFuture}.
*/
@Nonnull
CompletionStage<Optional<LastSyncCustomObject>> getLastSyncCustomObject(
CompletableFuture<Optional<LastSyncCustomObject>> getLastSyncCustomObject(
@Nonnull final String sourceProjectKey,
@Nonnull final String syncModuleName,
@Nullable final String runnerName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;

Expand All @@ -33,7 +32,7 @@ public CustomObjectServiceImpl(@Nonnull final ProjectApiRoot ctpClient) {

@Nonnull
@Override
public CompletionStage<ZonedDateTime> getCurrentCtpTimestamp(
public CompletableFuture<ZonedDateTime> getCurrentCtpTimestamp(
@Nullable final String runnerName, @Nonnull final String syncModuleName) {

final String container = buildCurrentCtpTimestampContainerName(syncModuleName, runnerName);
Expand Down

0 comments on commit 092e389

Please sign in to comment.