Class AbstractComparableServiceSelector<T>
- java.lang.Object
-
- nl.elec332.util.implementationmanager.AbstractComparableServiceSelector<T>
-
- All Implemented Interfaces:
IServiceSelector<T>
- Direct Known Subclasses:
ExtensionImplementationSelector,VersionedServiceSelector
public abstract class AbstractComparableServiceSelector<T> extends java.lang.Object implements IServiceSelector<T>
Created by Elec332 on 19-4-2020 Abstract service selector for services that can easily be compared Will always return the max value
-
-
Constructor Summary
Constructors Constructor Description AbstractComparableServiceSelector(java.util.Comparator<T> comparator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TgetBestService(java.util.Collection<T> implementations)Determines the best implementation ofg a service and returns it-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface nl.elec332.util.implementationmanager.api.IServiceSelector
getType, loadService
-
-
-
-
Constructor Detail
-
AbstractComparableServiceSelector
public AbstractComparableServiceSelector(java.util.Comparator<T> comparator)
-
-
Method Detail
-
getBestService
public final T getBestService(java.util.Collection<T> implementations)
Description copied from interface:IServiceSelectorDetermines the best implementation ofg a service and returns it- Specified by:
getBestServicein interfaceIServiceSelector<T>- Parameters:
implementations- All discovered service implementations- Returns:
- The best service implementation
-
-