Skip to content

Commit

Permalink
changed nonnull annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
soimugeo committed Oct 14, 2024
1 parent ad4b8db commit 5cd3f8b
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<PostCoordinationCustomScalesValueEvent, Document> {
public class PostCoordinationCustomScalesWritingConverter implements Converter<PostCoordinationCustomScalesValueEvent, Document> {
private final ObjectMapper objectMapper;

public PostCoordinationCustomScalesWritingConverter(ObjectMapper objectMapper) {
Expand All @@ -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);
}
}
Original file line number Diff line number Diff line change
@@ -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<AddEntityCustomScalesRevisionRequest, AddEntityCustomScalesRevisionResponse> {

Expand All @@ -17,7 +16,7 @@ public AddEntityCustomScalesRevisionCommandHandler(PostCoordinationEventProcesso
this.eventProcessor = eventProcessor;
}

@NotNull
@NonNull
@Override
public String getChannelName() {
return AddEntityCustomScalesRevisionRequest.CHANNEL;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -17,7 +15,7 @@ public AddEntitySpecificationRevisionCommandHandler(PostCoordinationEventProcess
this.eventProcessor = eventProcessor;
}

@NotNull
@NonNull
@Override
public String getChannelName() {
return AddEntitySpecificationRevisionRequest.CHANNEL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;


Expand All @@ -19,7 +19,7 @@ public GetEntityCustomScaleValuesCommandHandler(PostCoordinationEventProcessor p
this.postCoordinationEventProcessor = postCoordinationEventProcessor;
}

@NotNull
@NonNull
@Override
public String getChannelName() {
return GetEntityCustomScaleValuesRequest.CHANNEL;
Expand Down
Original file line number Diff line number Diff line change
@@ -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<GetEntityPostCoordinationRequest, GetEntityPostCoordinationResponse> {

Expand All @@ -25,7 +18,7 @@ public GetEntityPostCoordinationCommandHandler(PostCoordinationEventProcessor po
this.postCoordinationEventProcessor = postCoordinationEventProcessor;
}

@NotNull
@NonNull
@Override
public String getChannelName() {
return GetEntityPostCoordinationRequest.CHANNEL;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -17,7 +17,7 @@ public GetPostCoordinationAxisToGenericScaleCommandHandler(PostcoordinationAxisT
this.axisToGenericScaleRepository = axisToGenericScaleRepository;
}

@NotNull
@NonNull
@Override
public String getChannelName() {
return GetPostcoordinationAxisToGenericScaleRequest.CHANNEL;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -23,7 +20,7 @@ public GetTablePostCoordinationAxisHandler(PostCoordinationTableConfigRepository
}


@NotNull
@NonNull
@Override
public String getChannelName() {
return GetTablePostCoordinationAxisRequest.CHANNEL;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -19,7 +17,7 @@ public UploadFirstCustomScalesValuesHandler(PostCoordinationService postCoordina
this.postCoordinationService = postCoordinationService;
}

@NotNull
@NonNull
@Override
public String getChannelName() {
return CHANNEL;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;


Expand All @@ -21,7 +18,7 @@ public UploadPostCoordinationCommandHandler(PostCoordinationService postCoordina
this.postCoordinationService = postCoordinationService;
}

@NotNull
@NonNull
@Override
public String getChannelName() {
return UploadPostCoordinationRequest.CHANNEL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@

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<PostCoordinationViewEvent> postCoordinationEvents) implements Comparable<PostCoordinationSpecificationRevision>{
Set<PostCoordinationViewEvent> postCoordinationEvents) implements Comparable<PostCoordinationSpecificationRevision> {


public static PostCoordinationSpecificationRevision create(UserId userId, Set<PostCoordinationViewEvent> postCoordinationEventList) {
return new PostCoordinationSpecificationRevision(userId, Instant.now().toEpochMilli(), postCoordinationEventList);
}

@Override
public int compareTo(@NotNull PostCoordinationSpecificationRevision o) {
public int compareTo(@NonNull PostCoordinationSpecificationRevision o) {
return Long.compare(this.timestamp, o.timestamp);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
package edu.stanford.protege.webprotege.postcoordinationservice.model;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.*;
import edu.stanford.protege.webprotege.postcoordinationservice.dto.PostCoordinationSpecification;
import org.jetbrains.annotations.NotNull;
import org.springframework.lang.NonNull;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.*;

public record WhoficEntityPostCoordinationSpecification(@JsonProperty("whoficEntityIri") String whoficEntityIri, @JsonProperty("entityType") String entityType,
public record WhoficEntityPostCoordinationSpecification(@JsonProperty("whoficEntityIri") String whoficEntityIri,
@JsonProperty("entityType") String entityType,
@JsonProperty("postcoordinationSpecifications") List<PostCoordinationSpecification> postcoordinationSpecifications) {

@JsonCreator
public WhoficEntityPostCoordinationSpecification(@JsonProperty("whoficEntityIri") @NotNull String whoficEntityIri,
public WhoficEntityPostCoordinationSpecification(@JsonProperty("whoficEntityIri") @NonNull String whoficEntityIri,
@JsonProperty("entityType") String entityType,
@JsonProperty("postcoordinationSpecifications") List<PostCoordinationSpecification> postcoordinationSpecifications) {
this.whoficEntityIri = whoficEntityIri;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand Down

0 comments on commit 5cd3f8b

Please sign in to comment.