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

edu.stanford.protege.webprotege.change.description.AbstractMovedProperties Maven / Gradle / Ivy

The newest version!
package edu.stanford.protege.webprotege.change.description;

import com.google.common.collect.ImmutableSet;
import edu.stanford.protege.webprotege.owlapi.OWLObjectStringFormatter;
import org.semanticweb.owlapi.model.OWLProperty;

import javax.annotation.Nonnull;

/**
 * Matthew Horridge
 * Stanford Center for Biomedical Informatics Research
 * 2018-12-10
 */
public abstract class AbstractMovedProperties implements StructuredChangeDescription {

    @Nonnull
    public abstract ImmutableSet getProperties();

    @Nonnull
    public abstract ImmutableSet getFrom();

    @Nonnull
    public abstract OWLProperty getTo();

    @Nonnull
    @Override
    public String formatDescription(@Nonnull OWLObjectStringFormatter formatter) {
        if(getProperties().size() == 1) {
            return formatter.formatString("Moved property %s from %s to %s", getProperties(), getFrom(), getTo());
        }
        else {
            return formatter.formatString("Moved properties %s from %s to %s", getProperties(), getFrom(), getTo());
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy