接口 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
方法概要
所有方法 静态方法 实例方法 抽象方法 已过时的方法 修饰符和类型 方法 说明 static String
getRootPath(List<PathMapper> pathMappers, EndpointId endpointId)
Resolve the root path for the specifiedendpointId
from the given path mappers.String
getRootPath(EndpointId endpointId)
Resolve the root path for the specifiedendpointId
.static PathMapper
useEndpointId()
已过时。since 2.1.0 in favor ofgetRootPath(List, EndpointId)
with anull
list
方法详细资料
getRootPath
String getRootPath(EndpointId endpointId)
Resolve the root path for the specifiedendpointId
.- 参数:
endpointId
- the id of an endpoint- 返回:
- the path of the endpoint or
null
if this mapper doesn't support the given endpoint ID
useEndpointId
@Deprecated static PathMapper useEndpointId()
已过时。since 2.1.0 in favor ofgetRootPath(List, EndpointId)
with anull
listReturns anPathMapper
that uses the endpoint ID as the path.- 返回:
- an
PathMapper
that uses the lowercase endpoint ID as the path
getRootPath
static String getRootPath(List<PathMapper> pathMappers, EndpointId endpointId)
Resolve the root path for the specifiedendpointId
from the given path mappers. If no mapper matches then the ID itself is returned.- 参数:
pathMappers
- the path mappers (may benull
)endpointId
- the id of an endpoint- 返回:
- the path of the endpoint