Skip to content

Commit

Permalink
Added constructor that omits the resultsSetFilter for backwards compa…
Browse files Browse the repository at this point in the history
…tibility
  • Loading branch information
matthewhorridge committed Dec 2, 2024
1 parent 70d9bb3 commit 6ab7fe4
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@


@JsonTypeName("webprotege.search.PerformEntitySearch")
public record PerformEntitySearchAction(@JsonProperty(value = "projectId", required = true) @Nonnull ProjectId projectId,
@JsonProperty(value = "searchString", required = true) @Nonnull String searchString,
@JsonProperty(value = "entityTypes", defaultValue = "[]") @Nonnull Set<EntityType<?>> entityTypes,
@JsonProperty("langTagFilter") @Nonnull LangTagFilter langTagFilter,
@JsonProperty("searchFilters") @Nonnull ImmutableList<EntitySearchFilter> searchFilters,
@JsonProperty("pageRequest") @Nonnull PageRequest pageRequest,
@JsonProperty("resultsSetFilter") @Nullable EntityMatchCriteria resultsSetFilter) implements ProjectAction<PerformEntitySearchResult>, HasProjectId {
public record PerformEntitySearchAction(
@JsonProperty(value = "projectId", required = true) @Nonnull ProjectId projectId,
@JsonProperty(value = "searchString", required = true) @Nonnull String searchString,
@JsonProperty(value = "entityTypes", defaultValue = "[]") @Nonnull Set<EntityType<?>> entityTypes,
@JsonProperty("langTagFilter") @Nonnull LangTagFilter langTagFilter,
@JsonProperty("searchFilters") @Nonnull ImmutableList<EntitySearchFilter> searchFilters,
@JsonProperty("pageRequest") @Nonnull PageRequest pageRequest,
@JsonProperty("resultsSetFilter") @Nullable EntityMatchCriteria resultsSetFilter) implements ProjectAction<PerformEntitySearchResult>, HasProjectId {

public static final String CHANNEL = "webprotege.search.PerformEntitySearch";

Expand All @@ -55,6 +56,10 @@ public PerformEntitySearchAction(@JsonProperty("projectId") @Nonnull ProjectId p
this.resultsSetFilter = requireNonNullElse(resultsSetFilter, EntityTypeIsOneOfCriteria.get(ImmutableSet.copyOf(entityTypes)));
}

public PerformEntitySearchAction(@Nonnull ProjectId projectId, @Nonnull String searchString, @Nonnull Set<EntityType<?>> entityTypes, @Nonnull LangTagFilter langTagFilter, @Nonnull ImmutableList<EntitySearchFilter> searchFilters, @Nonnull PageRequest pageRequest) {
this(projectId, searchString, entityTypes, langTagFilter, searchFilters, pageRequest, null);
}

@Override
public String getChannel() {
return CHANNEL;
Expand Down

0 comments on commit 6ab7fe4

Please sign in to comment.