Class TagFilter<T>

java.lang.Object
jadex.providedservice.impl.search.TagFilter<T>
All Implemented Interfaces:
jadex.model.IAsyncFilter<T>

public class TagFilter<T> extends Object implements jadex.model.IAsyncFilter<T>
Tag filter class. Allows for filtering according to a collection of tags. Includes only services that contain all the tags. Replaces variables to dynamic values and uses TagProperty.createRuntimeTags() for that.
  • Field Details

  • Constructor Details

    • TagFilter

      public TagFilter()
    • TagFilter

      public TagFilter(jadex.core.IComponent component, String... tags)
      Create a new tag filter.
    • TagFilter

      public TagFilter(jadex.core.IComponent component, Collection<String> tags)
      Create a new tag filter.
  • Method Details

    • filter

      public jadex.future.IFuture<Boolean> filter(T ts)
      Filter if a service contains all the tags.
      Specified by:
      filter in interface jadex.model.IAsyncFilter<T>
    • getTags

      public Collection<String> getTags()
      Returns:
      the tags
    • setTags

      public void setTags(Collection<String> tags)
      Sets the tags.
      Parameters:
      tags - The tags to set
    • createRuntimeTags

      public static Collection<String> createRuntimeTags(Object vals)
      Create a collection of tags and replace the variable values.
    • convertToCollection

      protected static Collection<String> convertToCollection(Object obj)
      Convert user defined tag(s) to collection.