Class Services


  • public final class Services
    extends java.lang.Object
    Tools for working with ServiceLoaders.
    Since:
    4.8.0
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <P> @NotNull java.util.Optional<P> service​(@NotNull java.lang.Class<P> type)
      Locates a service.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • service

        @NotNull
        public static <P> @NotNull java.util.Optional<P> service​(@NotNull
                                                                 @NotNull java.lang.Class<P> type)
        Locates a service.
        Type Parameters:
        P - the service type
        Parameters:
        type - the service type
        Returns:
        a service, or Optional.empty()
        Since:
        4.8.0