@Override protected PathMappingResult doApply(PathMappingContext mappingCtx) { final String path = mappingCtx.path(); if (!path.startsWith(pathPrefix)) { return PathMappingResult.empty(); } final PathMappingResult result = mapping.apply(mappingCtx.overridePath(path.substring(pathPrefix.length() - 1))); if (result.isPresent()) { return PathMappingResult.of(path, mappingCtx.query(), result.pathParams()); } else { return PathMappingResult.empty(); } }
@Override public PathMapped<V> find(PathMappingContext mappingCtx) { final V cached = cache.getIfPresent(mappingCtx); if (cached != null) { // PathMappingResult may be different to each other for every requests, so we cannot // use it as a cache value. final PathMapping mapping = pathMappingResolver.apply(cached); final PathMappingResult mappingResult = mapping.apply(mappingCtx); return PathMapped.of(mapping, mappingResult, cached); } final PathMapped<V> result = delegate.find(mappingCtx); if (result.isPresent()) { cache.put(mappingCtx, result.value()); } return result; }
@Override public PathMappingResult apply(PathMappingContext mappingCtx) { final PathMappingResult result = pathStringMapping.apply(mappingCtx); if (!result.isPresent()) { if (mappingCtx.isCorsPreflight() && !mappingCtx.delayedThrowable().isPresent()) {
for (V value : values) { final PathMapping mapping = pathMappingResolver.apply(value); final PathMappingResult mappingResult = mapping.apply(mappingCtx); if (mappingResult.isPresent()) {