Interface PathMapper

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface PathMapper
    Strategy interface used to provide a mapping between an endpoint ID and the root path where it will be exposed.
    Since:
    2.0.0
    • Method Detail

      • getRootPath

        String getRootPath​(EndpointId endpointId)
        Resolve the root path for the specified endpointId.
        Parameters:
        endpointId - the id of an endpoint
        Returns:
        the path of the endpoint or null if this mapper doesn't support the given endpoint ID
      • getRootPath

        static String getRootPath​(List<PathMapper> pathMappers,
                                  EndpointId endpointId)
        Resolve the root path for the specified endpointId from the given path mappers. If no mapper matches then the ID itself is returned.
        Parameters:
        pathMappers - the path mappers (may be null)
        endpointId - the id of an endpoint
        Returns:
        the path of the endpoint