Class SurrogateQueryRegistry

java.lang.Object
tools.refinery.interpreter.matchers.context.surrogate.SurrogateQueryRegistry

public class SurrogateQueryRegistry extends Object
  • Method Details

    • instance

      public static SurrogateQueryRegistry instance()
    • registerSurrogateQueryForFeature

      public IProvider<PQuery> registerSurrogateQueryForFeature(IInputKey feature, PQuery surrogateQuery)
      Parameters:
      feature -
      surrogateQuery -
      Returns:
      the previous surrogate query associated with feature, or null if there was no such query FQN registered
      Throws:
      IllegalArgumentException - if feature or surrogateQuery is null
    • registerSurrogateQueryForFeature

      public IProvider<PQuery> registerSurrogateQueryForFeature(IInputKey feature, IProvider<PQuery> surrogateQueryProvider)
      Parameters:
      feature -
      surrogateQuery -
      Returns:
      the previous surrogate query associated with feature, or null if there was no such query registered
      Throws:
      IllegalArgumentException - if feature or surrogateQuery is null
    • addDynamicSurrogateQueryForFeature

      public IProvider<PQuery> addDynamicSurrogateQueryForFeature(IInputKey feature, PQuery surrogateQuery)
    • addDynamicSurrogateQueryForFeature

      public IProvider<PQuery> addDynamicSurrogateQueryForFeature(IInputKey feature, IProvider<PQuery> surrogateQuery)
    • removeDynamicSurrogateQueryForFeature

      public IProvider<PQuery> removeDynamicSurrogateQueryForFeature(IInputKey feature)
    • hasSurrogateQueryFQN

      public boolean hasSurrogateQueryFQN(IInputKey feature)
      Parameters:
      feature - that may have surrogate query defined, null not allowed
      Returns:
      true if the feature has a surrogate query defined
      Throws:
      IllegalArgumentException - if feature is null
    • getSurrogateQuery

      public PQuery getSurrogateQuery(IInputKey feature)
      Parameters:
      feature - for which the surrogate query FQN should be returned
      Returns:
      the surrogate query FQN defined for the feature
      Throws:
      IllegalArgumentException - if feature is null
      NoSuchElementException - if the feature has no surrogate query defined, use hasSurrogateQueryFQN(tools.refinery.interpreter.matchers.context.IInputKey) to check
    • getRegisteredSurrogateQueries

      public Set<IInputKey> getRegisteredSurrogateQueries()
      Returns:
      an unmodifiable set of features with registered surrogate queries
    • getDynamicSurrogateQueries

      public Set<IInputKey> getDynamicSurrogateQueries()
      Returns:
      an unmodifiable set of features with dynamically added surrogate queries
    • getAllSurrogateQueries

      public Set<IInputKey> getAllSurrogateQueries()
      Returns:
      an unmodifiable set that contains all features with surrogate queries.