-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMergeEntitiesAction.java
More file actions
57 lines (50 loc) · 2.74 KB
/
Copy pathMergeEntitiesAction.java
File metadata and controls
57 lines (50 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package edu.stanford.protege.webprotege.entity;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.google.common.collect.ImmutableSet;
import edu.stanford.protege.webprotege.common.ChangeRequestId;
import edu.stanford.protege.webprotege.common.ContentChangeRequest;
import edu.stanford.protege.webprotege.common.ProjectId;
import edu.stanford.protege.webprotege.dispatch.ProjectAction;
import org.semanticweb.owlapi.model.OWLEntity;
import javax.annotation.Nonnull;
import static com.google.common.base.Preconditions.checkNotNull;
/**
* Matthew Horridge
* Stanford Center for Biomedical Informatics Research
* 9 Mar 2018
*
* Creates a {@link MergeEntitiesAction}. An term merge is directional – one term is merged into
* another term.
* @param changeRequestId
* @param projectId The project to perform the merge in.
* @param sourceEntities The entities that will be merged into another term.
* @param targetEntity The term that will have the source term merged into it.
* @param treatment The treatment for the merged term that specifies whether the merged term
*/
@JsonTypeName("webprotege.entities.MergeEntities")
public record MergeEntitiesAction(@JsonProperty("changeRequestId") @Nonnull ChangeRequestId changeRequestId,
@JsonProperty("projectId") @Nonnull ProjectId projectId,
@JsonProperty("sourceEntities") @Nonnull ImmutableSet<OWLEntity> sourceEntities,
@JsonProperty("targetEntity") @Nonnull OWLEntity targetEntity,
@JsonProperty("treatment") @Nonnull MergedEntityTreatment treatment,
@JsonProperty("commitMessage") @Nonnull String commitMessage) implements ProjectAction<MergeEntitiesResult>, ContentChangeRequest {
public static final String CHANNEL = "webprotege.entities.MergeEntities";
@Override
public String getChannel() {
return CHANNEL;
}
public MergeEntitiesAction(@Nonnull ChangeRequestId changeRequestId,
@Nonnull ProjectId projectId,
@Nonnull ImmutableSet<OWLEntity> sourceEntities,
@Nonnull OWLEntity targetEntity,
@Nonnull MergedEntityTreatment treatment,
@Nonnull String commitMessage) {
this.changeRequestId = checkNotNull(changeRequestId);
this.projectId = checkNotNull(projectId);
this.sourceEntities = checkNotNull(sourceEntities);
this.targetEntity = checkNotNull(targetEntity);
this.treatment = checkNotNull(treatment);
this.commitMessage = checkNotNull(commitMessage);
}
}