Top Fields Constructors Methods
org.eclipse.jetty.http.pathmap

public Class MappedResource<E>

extends Object
implements Comparable<MappedResource<E>>, Map.Entry<PathSpec, E>
Class Inheritance
All Implemented Interfaces
java.util.Map.Entry, java.lang.Comparable
Annotations
@ManagedObject:Mapped Resource
Imports
java.util.Map, org.eclipse.jetty.util.annotation.ManagedAttribute, .ManagedObject

Field Summary

Modifier and TypeField and Description
private final PathSpec
private final MatchedResource<E>
private final E

Constructor Summary

AccessConstructor and Description
public
MappedResource(PathSpec pathSpec, E resource)

Method Summary

Modifier and TypeMethod and Description
public int
compareTo(MappedResource<E>
the object to be compared.
other
)

Implements java.lang.Comparable.compareTo.

Comparison is based solely on the pathSpec
public boolean
equals(Object
object to be compared for equality with this map entry
obj
)

Overrides java.lang.Object.equals.

Implements java.util.Map.Entry.equals.

Compares the specified object with this entry for equality.
public PathSpec
getKey()

Implements java.util.Map.Entry.getKey.

Returns the key corresponding to this entry.
public PathSpec
public MatchedResource<E>

Returns:

A pre match MatchedResource for ROOT and EXACT matches, else null;
getPreMatched
()

public E
public E
getValue()

Implements java.util.Map.Entry.getValue.

Returns the value corresponding to this entry.
public int
hashCode()

Overrides java.lang.Object.hashCode.

Implements java.util.Map.Entry.hashCode.

Returns the hash code value for this map entry.
public E
setValue(E
new value to be stored in this entry
value
)

Implements java.util.Map.Entry.setValue.

Replaces the value corresponding to this entry with the specified value (optional operation).
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

pathSpecback to summary
private final PathSpec pathSpec
preMatchedback to summary
private final MatchedResource<E> preMatched
resourceback to summary
private final E resource

Constructor Detail

MappedResourceback to summary
public MappedResource(PathSpec pathSpec, E resource)

Method Detail

compareToback to summary
public int compareTo(MappedResource<E> other)

Implements java.lang.Comparable.compareTo.

Comparison is based solely on the pathSpec

Parameters
other:MappedResource<E>

Doc from java.lang.Comparable.compareTo.

the object to be compared.

Returns:int

Doc from java.lang.Comparable.compareTo.

a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Annotations
@Override
equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Implements java.util.Map.Entry.equals.

Doc from java.util.Map.Entry.equals.

Compares the specified object with this entry for equality. Returns true if the given object is also a map entry and the two entries represent the same mapping. More formally, two entries e1 and e2 represent the same mapping if

    (e1.getKey()==null ?
     e2.getKey()==null : e1.getKey().equals(e2.getKey()))  &&
    (e1.getValue()==null ?
     e2.getValue()==null : e1.getValue().equals(e2.getValue()))
This ensures that the equals method works properly across different implementations of the Map.Entry interface.
Parameters
obj:Object

object to be compared for equality with this map entry

Returns:boolean

true if the specified object is equal to this map entry

Annotations
@Override
getKeyback to summary
public PathSpec getKey()

Implements java.util.Map.Entry.getKey.

Doc from java.util.Map.Entry.getKey.

Returns the key corresponding to this entry.

Returns:PathSpec

the key corresponding to this entry

Annotations
@Override
getPathSpecback to summary
public PathSpec getPathSpec()
Annotations
@ManagedAttribute:path spec
readonly:true
getPreMatchedback to summary
public MatchedResource<E> getPreMatched()
Returns:MatchedResource<E>

A pre match MatchedResource for ROOT and EXACT matches, else null;

getResourceback to summary
public E getResource()
Annotations
@ManagedAttribute:resource
readonly:true
getValueback to summary
public E getValue()

Implements java.util.Map.Entry.getValue.

Doc from java.util.Map.Entry.getValue.

Returns the value corresponding to this entry. If the mapping has been removed from the backing map (by the iterator's remove operation), the results of this call are undefined.

Returns:E

the value corresponding to this entry

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Implements java.util.Map.Entry.hashCode.

Doc from java.util.Map.Entry.hashCode.

Returns the hash code value for this map entry. The hash code of a map entry e is defined to be:

    (e.getKey()==null   ? 0 : e.getKey().hashCode()) ^
    (e.getValue()==null ? 0 : e.getValue().hashCode())
This ensures that e1.equals(e2) implies that e1.hashCode()==e2.hashCode() for any two Entries e1 and e2, as required by the general contract of Object.hashCode.
Returns:int

the hash code value for this map entry

Annotations
@Override
setValueback to summary
public E setValue(E value)

Implements java.util.Map.Entry.setValue.

Doc from java.util.Map.Entry.setValue.

Replaces the value corresponding to this entry with the specified value (optional operation). (Writes through to the map.) The behavior of this call is undefined if the mapping has already been removed from the map (by the iterator's remove operation).

Parameters
value:E

new value to be stored in this entry

Returns:E

old value corresponding to the entry

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override