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

edu.stanford.protege.webprotege.match.SubClassOfMatcherFactory Maven / Gradle / Ivy

The newest version!
package edu.stanford.protege.webprotege.match;

import edu.stanford.protege.webprotege.hierarchy.ClassHierarchyProvider;
import edu.stanford.protege.webprotege.criteria.HierarchyFilterType;
import javax.inject.Inject;
import javax.inject.Provider;
import org.semanticweb.owlapi.model.OWLClass;

public final class SubClassOfMatcherFactory {
  private final Provider providerProvider;

  @Inject
  public SubClassOfMatcherFactory(Provider providerProvider) {
    this.providerProvider = checkNotNull(providerProvider, 1);
  }

  public SubClassOfMatcher create(OWLClass cls, HierarchyFilterType filterType) {
    return new SubClassOfMatcher(
        checkNotNull(providerProvider.get(), 1), checkNotNull(cls, 2), checkNotNull(filterType, 3));
  }

  private static  T checkNotNull(T reference, int argumentIndex) {
    if (reference == null) {
      throw new NullPointerException(
          " method argument is null but is not marked @Nullable. Argument index: "
              + argumentIndex);
    }
    return reference;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy