From 5cd3f8bff8471bdbbf21cf91989cb5562484626a Mon Sep 17 00:00:00 2001 From: Gheorghe Soimu Date: Mon, 14 Oct 2024 17:44:48 +0300 Subject: [PATCH] changed nonnull annotation --- ...tCoordinationCustomScalesWritingConverter.java | 7 +++---- ...dEntityCustomScalesRevisionCommandHandler.java | 9 ++++----- ...EntitySpecificationRevisionCommandHandler.java | 8 +++----- .../GetEntityCustomScaleValuesCommandHandler.java | 4 ++-- .../GetEntityPostCoordinationCommandHandler.java | 15 ++++----------- ...rdinationAxisToGenericScaleCommandHandler.java | 8 ++++---- .../GetTablePostCoordinationAxisHandler.java | 11 ++++------- .../UploadFirstCustomScalesValuesHandler.java | 8 +++----- .../UploadPostCoordinationCommandHandler.java | 11 ++++------- .../PostCoordinationCustomScalesRevision.java | 4 ++-- .../PostCoordinationSpecificationRevision.java | 6 +++--- ...WhoficEntityPostCoordinationSpecification.java | 14 ++++++-------- .../changes/NewRevisionsEvent.java | 6 +++--- 13 files changed, 45 insertions(+), 66 deletions(-) diff --git a/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/config/PostCoordinationCustomScalesWritingConverter.java b/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/config/PostCoordinationCustomScalesWritingConverter.java index 85c114b..e3c56ad 100644 --- a/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/config/PostCoordinationCustomScalesWritingConverter.java +++ b/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/config/PostCoordinationCustomScalesWritingConverter.java @@ -2,14 +2,13 @@ import com.fasterxml.jackson.databind.ObjectMapper; import edu.stanford.protege.webprotege.postcoordinationservice.events.PostCoordinationCustomScalesValueEvent; -import edu.stanford.protege.webprotege.postcoordinationservice.events.PostCoordinationSpecificationEvent; import org.bson.Document; -import org.jetbrains.annotations.NotNull; import org.springframework.core.convert.converter.Converter; import org.springframework.data.convert.WritingConverter; +import org.springframework.lang.NonNull; @WritingConverter -public class PostCoordinationCustomScalesWritingConverter implements Converter { +public class PostCoordinationCustomScalesWritingConverter implements Converter { private final ObjectMapper objectMapper; public PostCoordinationCustomScalesWritingConverter(ObjectMapper objectMapper) { @@ -18,7 +17,7 @@ public PostCoordinationCustomScalesWritingConverter(ObjectMapper objectMapper) { @Override - public Document convert(@NotNull PostCoordinationCustomScalesValueEvent source) { + public Document convert(@NonNull PostCoordinationCustomScalesValueEvent source) { return objectMapper.convertValue(source, Document.class); } } diff --git a/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/AddEntityCustomScalesRevisionCommandHandler.java b/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/AddEntityCustomScalesRevisionCommandHandler.java index 3d81f9d..74ae9a3 100644 --- a/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/AddEntityCustomScalesRevisionCommandHandler.java +++ b/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/AddEntityCustomScalesRevisionCommandHandler.java @@ -1,13 +1,12 @@ package edu.stanford.protege.webprotege.postcoordinationservice.handlers; -import edu.stanford.protege.webprotege.ipc.CommandHandler; -import edu.stanford.protege.webprotege.ipc.ExecutionContext; -import edu.stanford.protege.webprotege.ipc.WebProtegeHandler; +import edu.stanford.protege.webprotege.ipc.*; import edu.stanford.protege.webprotege.postcoordinationservice.services.PostCoordinationEventProcessor; -import org.jetbrains.annotations.NotNull; +import org.springframework.lang.NonNull; import reactor.core.publisher.Mono; + @WebProtegeHandler public class AddEntityCustomScalesRevisionCommandHandler implements CommandHandler { @@ -17,7 +16,7 @@ public AddEntityCustomScalesRevisionCommandHandler(PostCoordinationEventProcesso this.eventProcessor = eventProcessor; } - @NotNull + @NonNull @Override public String getChannelName() { return AddEntityCustomScalesRevisionRequest.CHANNEL; diff --git a/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/AddEntitySpecificationRevisionCommandHandler.java b/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/AddEntitySpecificationRevisionCommandHandler.java index ec0bc8c..7b9cc19 100644 --- a/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/AddEntitySpecificationRevisionCommandHandler.java +++ b/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/AddEntitySpecificationRevisionCommandHandler.java @@ -1,11 +1,9 @@ package edu.stanford.protege.webprotege.postcoordinationservice.handlers; -import edu.stanford.protege.webprotege.ipc.CommandHandler; -import edu.stanford.protege.webprotege.ipc.ExecutionContext; -import edu.stanford.protege.webprotege.ipc.WebProtegeHandler; +import edu.stanford.protege.webprotege.ipc.*; import edu.stanford.protege.webprotege.postcoordinationservice.services.PostCoordinationEventProcessor; -import org.jetbrains.annotations.NotNull; +import org.springframework.lang.NonNull; import reactor.core.publisher.Mono; @WebProtegeHandler @@ -17,7 +15,7 @@ public AddEntitySpecificationRevisionCommandHandler(PostCoordinationEventProcess this.eventProcessor = eventProcessor; } - @NotNull + @NonNull @Override public String getChannelName() { return AddEntitySpecificationRevisionRequest.CHANNEL; diff --git a/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/GetEntityCustomScaleValuesCommandHandler.java b/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/GetEntityCustomScaleValuesCommandHandler.java index e4ceb08..516dcac 100644 --- a/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/GetEntityCustomScaleValuesCommandHandler.java +++ b/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/GetEntityCustomScaleValuesCommandHandler.java @@ -5,7 +5,7 @@ import edu.stanford.protege.webprotege.postcoordinationservice.dto.*; import edu.stanford.protege.webprotege.postcoordinationservice.model.WhoficCustomScalesValues; import edu.stanford.protege.webprotege.postcoordinationservice.services.PostCoordinationEventProcessor; -import org.jetbrains.annotations.NotNull; +import org.springframework.lang.NonNull; import reactor.core.publisher.Mono; @@ -19,7 +19,7 @@ public GetEntityCustomScaleValuesCommandHandler(PostCoordinationEventProcessor p this.postCoordinationEventProcessor = postCoordinationEventProcessor; } - @NotNull + @NonNull @Override public String getChannelName() { return GetEntityCustomScaleValuesRequest.CHANNEL; diff --git a/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/GetEntityPostCoordinationCommandHandler.java b/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/GetEntityPostCoordinationCommandHandler.java index ac59449..22261be 100644 --- a/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/GetEntityPostCoordinationCommandHandler.java +++ b/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/GetEntityPostCoordinationCommandHandler.java @@ -1,20 +1,13 @@ package edu.stanford.protege.webprotege.postcoordinationservice.handlers; -import edu.stanford.protege.webprotege.ipc.CommandHandler; -import edu.stanford.protege.webprotege.ipc.ExecutionContext; -import edu.stanford.protege.webprotege.ipc.WebProtegeHandler; -import edu.stanford.protege.webprotege.postcoordinationservice.dto.GetEntityPostCoordinationRequest; -import edu.stanford.protege.webprotege.postcoordinationservice.dto.GetEntityPostCoordinationResponse; +import edu.stanford.protege.webprotege.ipc.*; +import edu.stanford.protege.webprotege.postcoordinationservice.dto.*; import edu.stanford.protege.webprotege.postcoordinationservice.model.WhoficEntityPostCoordinationSpecification; -import edu.stanford.protege.webprotege.postcoordinationservice.repositories.PostCoordinationSpecificationsRepository; import edu.stanford.protege.webprotege.postcoordinationservice.services.PostCoordinationEventProcessor; -import edu.stanford.protege.webprotege.postcoordinationservice.services.PostCoordinationService; -import org.jetbrains.annotations.NotNull; +import org.springframework.lang.NonNull; import reactor.core.publisher.Mono; -import java.util.Collections; - @WebProtegeHandler public class GetEntityPostCoordinationCommandHandler implements CommandHandler { @@ -25,7 +18,7 @@ public GetEntityPostCoordinationCommandHandler(PostCoordinationEventProcessor po this.postCoordinationEventProcessor = postCoordinationEventProcessor; } - @NotNull + @NonNull @Override public String getChannelName() { return GetEntityPostCoordinationRequest.CHANNEL; diff --git a/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/GetPostCoordinationAxisToGenericScaleCommandHandler.java b/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/GetPostCoordinationAxisToGenericScaleCommandHandler.java index 9aa00e9..e76c363 100644 --- a/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/GetPostCoordinationAxisToGenericScaleCommandHandler.java +++ b/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/GetPostCoordinationAxisToGenericScaleCommandHandler.java @@ -1,9 +1,9 @@ package edu.stanford.protege.webprotege.postcoordinationservice.handlers; import edu.stanford.protege.webprotege.ipc.*; -import edu.stanford.protege.webprotege.postcoordinationservice.model.*; -import edu.stanford.protege.webprotege.postcoordinationservice.repositories.*; -import org.jetbrains.annotations.NotNull; +import edu.stanford.protege.webprotege.postcoordinationservice.model.PostcoordinationAxisToGenericScale; +import edu.stanford.protege.webprotege.postcoordinationservice.repositories.PostcoordinationAxisToGenericScaleRepository; +import org.springframework.lang.NonNull; import reactor.core.publisher.Mono; import java.util.List; @@ -17,7 +17,7 @@ public GetPostCoordinationAxisToGenericScaleCommandHandler(PostcoordinationAxisT this.axisToGenericScaleRepository = axisToGenericScaleRepository; } - @NotNull + @NonNull @Override public String getChannelName() { return GetPostcoordinationAxisToGenericScaleRequest.CHANNEL; diff --git a/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/GetTablePostCoordinationAxisHandler.java b/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/GetTablePostCoordinationAxisHandler.java index 86f6d0f..067a648 100644 --- a/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/GetTablePostCoordinationAxisHandler.java +++ b/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/GetTablePostCoordinationAxisHandler.java @@ -1,12 +1,9 @@ package edu.stanford.protege.webprotege.postcoordinationservice.handlers; -import edu.stanford.protege.webprotege.ipc.CommandHandler; -import edu.stanford.protege.webprotege.ipc.ExecutionContext; -import edu.stanford.protege.webprotege.ipc.WebProtegeHandler; -import edu.stanford.protege.webprotege.postcoordinationservice.model.TableAxisLabel; -import edu.stanford.protege.webprotege.postcoordinationservice.model.TableConfiguration; +import edu.stanford.protege.webprotege.ipc.*; +import edu.stanford.protege.webprotege.postcoordinationservice.model.*; import edu.stanford.protege.webprotege.postcoordinationservice.repositories.PostCoordinationTableConfigRepository; -import org.jetbrains.annotations.NotNull; +import org.springframework.lang.NonNull; import reactor.core.publisher.Mono; import java.util.List; @@ -23,7 +20,7 @@ public GetTablePostCoordinationAxisHandler(PostCoordinationTableConfigRepository } - @NotNull + @NonNull @Override public String getChannelName() { return GetTablePostCoordinationAxisRequest.CHANNEL; diff --git a/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/UploadFirstCustomScalesValuesHandler.java b/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/UploadFirstCustomScalesValuesHandler.java index 78aeb40..e3acc89 100644 --- a/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/UploadFirstCustomScalesValuesHandler.java +++ b/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/UploadFirstCustomScalesValuesHandler.java @@ -1,10 +1,8 @@ package edu.stanford.protege.webprotege.postcoordinationservice.handlers; -import edu.stanford.protege.webprotege.ipc.CommandHandler; -import edu.stanford.protege.webprotege.ipc.ExecutionContext; -import edu.stanford.protege.webprotege.ipc.WebProtegeHandler; +import edu.stanford.protege.webprotege.ipc.*; import edu.stanford.protege.webprotege.postcoordinationservice.services.PostCoordinationService; -import org.jetbrains.annotations.NotNull; +import org.springframework.lang.NonNull; import reactor.core.publisher.Mono; import static edu.stanford.protege.webprotege.postcoordinationservice.handlers.UploadFirstCustomScalesValuesRequest.CHANNEL; @@ -19,7 +17,7 @@ public UploadFirstCustomScalesValuesHandler(PostCoordinationService postCoordina this.postCoordinationService = postCoordinationService; } - @NotNull + @NonNull @Override public String getChannelName() { return CHANNEL; diff --git a/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/UploadPostCoordinationCommandHandler.java b/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/UploadPostCoordinationCommandHandler.java index b1adb00..8d8fc1d 100644 --- a/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/UploadPostCoordinationCommandHandler.java +++ b/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/handlers/UploadPostCoordinationCommandHandler.java @@ -1,12 +1,9 @@ package edu.stanford.protege.webprotege.postcoordinationservice.handlers; -import edu.stanford.protege.webprotege.ipc.CommandHandler; -import edu.stanford.protege.webprotege.ipc.ExecutionContext; -import edu.stanford.protege.webprotege.ipc.WebProtegeHandler; +import edu.stanford.protege.webprotege.ipc.*; import edu.stanford.protege.webprotege.postcoordinationservice.services.PostCoordinationService; -import org.jetbrains.annotations.NotNull; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.slf4j.*; +import org.springframework.lang.NonNull; import reactor.core.publisher.Mono; @@ -21,7 +18,7 @@ public UploadPostCoordinationCommandHandler(PostCoordinationService postCoordina this.postCoordinationService = postCoordinationService; } - @NotNull + @NonNull @Override public String getChannelName() { return UploadPostCoordinationRequest.CHANNEL; diff --git a/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/model/PostCoordinationCustomScalesRevision.java b/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/model/PostCoordinationCustomScalesRevision.java index 2ee8372..5e53680 100644 --- a/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/model/PostCoordinationCustomScalesRevision.java +++ b/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/model/PostCoordinationCustomScalesRevision.java @@ -3,8 +3,8 @@ import com.google.common.base.Objects; import edu.stanford.protege.webprotege.common.UserId; import edu.stanford.protege.webprotege.postcoordinationservice.events.PostCoordinationCustomScalesValueEvent; -import org.jetbrains.annotations.NotNull; import org.springframework.data.mongodb.core.index.*; +import org.springframework.lang.NonNull; import java.time.Instant; import java.util.Set; @@ -32,7 +32,7 @@ public int hashCode() { } @Override - public int compareTo(@NotNull PostCoordinationCustomScalesRevision o) { + public int compareTo(@NonNull PostCoordinationCustomScalesRevision o) { return Long.compare(this.timestamp, o.timestamp); } diff --git a/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/model/PostCoordinationSpecificationRevision.java b/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/model/PostCoordinationSpecificationRevision.java index 453cac3..5c3432f 100644 --- a/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/model/PostCoordinationSpecificationRevision.java +++ b/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/model/PostCoordinationSpecificationRevision.java @@ -3,15 +3,15 @@ import com.google.common.base.Objects; import edu.stanford.protege.webprotege.common.UserId; -import org.jetbrains.annotations.NotNull; import org.springframework.data.mongodb.core.index.*; +import org.springframework.lang.NonNull; import java.time.Instant; import java.util.Set; public record PostCoordinationSpecificationRevision(UserId userId, @Indexed(name = "spec_timestamp", direction = IndexDirection.DESCENDING) Long timestamp, - Set postCoordinationEvents) implements Comparable{ + Set postCoordinationEvents) implements Comparable { public static PostCoordinationSpecificationRevision create(UserId userId, Set postCoordinationEventList) { @@ -19,7 +19,7 @@ public static PostCoordinationSpecificationRevision create(UserId userId, Set postcoordinationSpecifications) { @JsonCreator - public WhoficEntityPostCoordinationSpecification(@JsonProperty("whoficEntityIri") @NotNull String whoficEntityIri, + public WhoficEntityPostCoordinationSpecification(@JsonProperty("whoficEntityIri") @NonNull String whoficEntityIri, @JsonProperty("entityType") String entityType, @JsonProperty("postcoordinationSpecifications") List postcoordinationSpecifications) { this.whoficEntityIri = whoficEntityIri; diff --git a/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/uiHistoryConcern/changes/NewRevisionsEvent.java b/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/uiHistoryConcern/changes/NewRevisionsEvent.java index 4f43768..b53f554 100644 --- a/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/uiHistoryConcern/changes/NewRevisionsEvent.java +++ b/src/main/java/edu/stanford/protege/webprotege/postcoordinationservice/uiHistoryConcern/changes/NewRevisionsEvent.java @@ -2,7 +2,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import edu.stanford.protege.webprotege.common.*; -import org.jetbrains.annotations.NotNull; +import org.springframework.lang.NonNull; import java.util.Set; @@ -21,13 +21,13 @@ public static NewRevisionsEvent create(EventId eventId, return new NewRevisionsEvent(eventId, projectId, changes); } - @NotNull + @NonNull @Override public ProjectId projectId() { return projectId; } - @NotNull + @NonNull @Override public EventId eventId() { return eventId;