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 Summary
All Methods Static Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description 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()
Deprecated.since 2.1.0 in favor ofgetRootPath(List, EndpointId)
with anull
list
Method Detail
getRootPath
String getRootPath(EndpointId endpointId)
Resolve the root path for the specifiedendpointId
.- 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
useEndpointId
@Deprecated static PathMapper useEndpointId()
Deprecated.since 2.1.0 in favor ofgetRootPath(List, EndpointId)
with anull
listReturns anPathMapper
that uses the endpoint ID as the path.- Returns:
- 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.- Parameters:
pathMappers
- the path mappers (may benull
)endpointId
- the id of an endpoint- Returns:
- the path of the endpoint