Class PathMappings<E>
- Type Parameters:
E- the type of mapping endpoint
- All Implemented Interfaces:
Iterable<MappedResource<E>>, Predicate<String>, Map<PathSpec,E>, org.eclipse.jetty.util.component.Dumpable
@ManagedObject("Path Mappings")
public class PathMappings<E>
extends AbstractMap<PathSpec,E>
implements Iterable<MappedResource<E>>, org.eclipse.jetty.util.component.Dumpable, Predicate<String>
Path Mappings of PathSpec to Resource.
Sorted into search order upon entry into the Set
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.Dumpable.DumpableContainer -
Field Summary
Fields inherited from interface org.eclipse.jetty.util.component.Dumpable
KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondump()voiddump(Appendable out, String indent) entrySet()getMatched(String path) Find the best single match for a path.getMatchedList(String path) Return a list of MatchedResource matches for the specified path.getMatches(String path) Return a list of MappedResource matches for the specified path.iterator()booleanremoveIf(Predicate<MappedResource<E>> predicate) voidreset()intsize()booleanTest if the mappings contains a specified path.toString()Methods inherited from class AbstractMap
clear, clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, valuesMethods inherited from interface org.eclipse.jetty.util.component.Dumpable
dumpSelfMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
PathMappings
public PathMappings()
-
-
Method Details
-
entrySet
-
dump
- Specified by:
dumpin interfaceorg.eclipse.jetty.util.component.Dumpable
-
dump
- Specified by:
dumpin interfaceorg.eclipse.jetty.util.component.Dumpable- Throws:
IOException
-
getMappings
-
size
-
reset
public void reset() -
streamResources
-
removeIf
-
getMatchedList
Return a list of MatchedResource matches for the specified path.- Parameters:
path- the path to return matches on- Returns:
- the list of mapped resource the path matches on
-
getMatches
Return a list of MappedResource matches for the specified path.- Parameters:
path- the path to return matches on- Returns:
- the list of mapped resource the path matches on
-
test
-
getMatched
Find the best single match for a path.
The match may be found by optimized direct lookups when possible, otherwise all mappings are iterated over and the first match returned
- Parameters:
path- The path to match- Returns:
- A
MatchedResourceinstance or null if no mappings matched. - See Also:
-
iterator
-
get
-
get
-
put
-
put
-
remove
-
remove
-
toString
- Overrides:
toStringin classAbstractMap<PathSpec,E>
-