All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.stanford.protege.webprotege.criteria.SubClassOfCriteria Maven / Gradle / Ivy

There is a newer version: 0.9.2
Show newest version
package edu.stanford.protege.webprotege.criteria;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.google.auto.value.AutoValue;
import org.semanticweb.owlapi.model.OWLClass;

import javax.annotation.Nonnull;

/**
 * Matthew Horridge
 * Stanford Center for Biomedical Informatics Research
 * 17 Jun 2018
 */
@AutoValue

@JsonTypeName("SubClassOf")
public abstract class SubClassOfCriteria implements EntityMatchCriteria, HierarchyPositionCriteria {

    private static final String TARGET = "target";

    private static final String FILTER_TYPE = "filterType";

    @JsonProperty(TARGET)
    @Nonnull
    public abstract OWLClass getTarget();

    @JsonProperty(FILTER_TYPE)
    public abstract HierarchyFilterType getFilterType();

    @JsonCreator
    @Nonnull
    public static SubClassOfCriteria get(@Nonnull @JsonProperty(TARGET) OWLClass target,
                                         @Nonnull @JsonProperty(FILTER_TYPE) HierarchyFilterType filterType) {
        return new AutoValue_SubClassOfCriteria(target, filterType);
    }

    @Override
    public  R accept(RootCriteriaVisitor visitor) {
        return visitor.visit(this);
    }

    @Override
    public  R accept(@Nonnull HierarchyPositionCriteriaVisitor visitor) {
        return visitor.visit(this);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy