接口 PathMapper

  • 函数接口:
    这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。

    @FunctionalInterface
    public interface PathMapper
    Strategy interface used to provide a mapping between an endpoint ID and the root path where it will be exposed.
    从以下版本开始:
    2.0.0
    • 方法详细资料

      • getRootPath

        String getRootPath​(EndpointId endpointId)
        Resolve the root path for the specified endpointId.
        参数:
        endpointId - the id of an endpoint
        返回:
        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.
        参数:
        pathMappers - the path mappers (may be null)
        endpointId - the id of an endpoint
        返回:
        the path of the endpoint