Class OslcCore.Finder<T>

java.lang.Object
com.sodius.oslc.core.model.OslcCore.Finder<T>
Type Parameters:
T - the type of capability to search for.
Enclosing class:
OslcCore

public abstract static class OslcCore.Finder<T> extends Object
Enables finding a capability provided by an OSLC service based on some criteria.
  • Method Details

    • forServices

      public static OslcCore.Finder<Service> forServices(ServiceProvider serviceProvider)
      Returns a finder that can search for services.
      Parameters:
      serviceProvider - the provider declaring services.
      Returns:
      a finder that can search for services.
    • forSelectionDialogs

      public static OslcCore.Finder<Dialog> forSelectionDialogs(Service service)
      Returns a finder that can search for selection dialogs.
      Parameters:
      service - the service declaring selection dialogs.
      Returns:
      a finder that can search for selection dialogs.
    • forCreationDialogs

      public static OslcCore.Finder<Dialog> forCreationDialogs(Service service)
      Returns a finder that can search for creation dialogs.
      Parameters:
      service - the service declaring creation dialogs.
      Returns:
      a finder that can search for creation dialogs.
    • forCreationFactories

      public static OslcCore.Finder<CreationFactory> forCreationFactories(Service service)
      Returns a finder that can search for creation factories.
      Parameters:
      service - the service declaring creation factories.
      Returns:
      a finder that can search for creation factories.
    • forQueryCapabilities

      public static OslcCore.Finder<QueryCapability> forQueryCapabilities(Service service)
      Returns a finder that can search for query capabilities.
      Parameters:
      service - the service declaring query capabilities.
      Returns:
      a finder that can search for query capabilities.
    • defaultUsage

      public final OslcCore.Finder<T> defaultUsage()
      Filters the capabilities to retain only the ones whose usage is "http://open-services.net/ns/core#default".
      Returns:
      the finder instance.
    • domain

      public final OslcCore.Finder<T> domain(URI domain)
      Filters the services to retain only the ones declaring given domain.
      Parameters:
      domain - the domain that the services must define.
      Returns:
      the find instance.
    • usage

      public final OslcCore.Finder<T> usage(URI usage)
      Filters the capabilities to retain only the ones declaring given usage.
      Parameters:
      usage - the usage that the capabilities must declare.
      Returns:
      the finder instance.
    • excludeUsage

      public final OslcCore.Finder<T> excludeUsage(URI usage)
      Filters the capabilities to reject the ones declaring given usage.
      Parameters:
      usage - the usage that the capabilities must not declare.
      Returns:
      the finder instance.
      Since:
      1.11.0
    • resourceType

      public final OslcCore.Finder<T> resourceType(URI resourceType)
      Filters the capabilities to retain only the ones declaring given resource type.
      Parameters:
      resourceType - the resource type the capabilities must declare.
      Returns:
      the finder instance.
    • excludeResourceType

      public final OslcCore.Finder<T> excludeResourceType(URI resourceType)
      Filters the capabilities to reject the ones declaring given resource type.
      Parameters:
      resourceType - the resource type the capabilities must not declare.
      Returns:
      the finder instance.
      Since:
      1.11.0
    • predicate

      public final OslcCore.Finder<T> predicate(Predicate<T> predicate)
      Filters the capabilities to retain only the ones verifying the given predicate.
      Parameters:
      predicate - the predicate the capabilities must verify.
      Returns:
      the finder instance.
      Since:
      1.11.0
    • findAll

      public final List<T> findAll()
      Returns all capabilities matching the specified criteria.
      Returns:
      the list of capabilities matching the specified criteria.
    • findFirst

      public final T findFirst()
      Returns the first capability matching the specified criteria.
      Returns:
      the first capability matching the specified criteria, null if none.