Package org.eclipse.jetty.http.pathmap
Class PathMappings<E>
- Type Parameters:
E
- the type of mapping endpoint
- All Implemented Interfaces:
Iterable<MappedResource<E>>
,Predicate<String>
,Map<PathSpec,
,E> Dumpable
@ManagedObject("Path Mappings")
public class PathMappings<E>
extends AbstractMap<PathSpec,E>
implements Iterable<MappedResource<E>>, 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 java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondump()
void
dump
(Appendable out, String indent) Dump this object (and children) into an Appendable using the provided indent after any new lines.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()
boolean
removeIf
(Predicate<MappedResource<E>> predicate) void
reset()
int
size()
boolean
Test if the mappings contains a specified path.toString()
Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, values
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
PathMappings
public PathMappings()
-
-
Method Details
-
entrySet
-
dump
-
dump
Description copied from interface:Dumpable
Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.- Specified by:
dump
in interfaceDumpable
- Parameters:
out
- The appendable to dump toindent
- The indent to apply after any new lines.- Throws:
IOException
- if unable to write to Appendable
-
getMappings
-
size
public int 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
Test if the mappings contains a specified path. -
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
MatchedResource
instance or null if no mappings matched. - See Also:
-
getMatchedIteratively(String)
-
iterator
-
get
-
get
-
put
-
put
-
remove
-
remove
-
toString
- Overrides:
toString
in classAbstractMap<PathSpec,
E>
-