Class AbstractComparableServiceSelector<T>

  • All Implemented Interfaces:
    IServiceSelector<T>
    Direct Known Subclasses:
    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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T getBestService​(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
    • 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: IServiceSelector
        Determines the best implementation ofg a service and returns it
        Specified by:
        getBestService in interface IServiceSelector<T>
        Parameters:
        implementations - All discovered service implementations
        Returns:
        The best service implementation