Package org.apache.juneau
Class StringRange
java.lang.Object
org.apache.juneau.StringRange
Represents a single value in a comma-delimited header value that optionally contains a quality metric for
 comparison and extension parameters.
 
 Similar in concept to MediaRanges except instead of media types (e.g. 
 An example of a type range is a value in an 
See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanReturnstrue if the specified object is also aStringRange , and has the same qValue, type, parameters, and extensions.forEachExtension(Consumer<NameValuePair> action) Performs an action on the optional set of custom extensions defined for this type.Returns the optional set of custom extensions defined for this type.getName()Returns the name of this string range.Returns the'q' (quality) value for this type, as described in Section 3.9 of RFC2616.inthashCode()Returns a hash based on this instance'smedia-type .intPerforms a match of this string range against the specified name.toString()
- 
Constructor Details- 
StringRangeConstructor.- Parameters:
- value- The raw string range string.
 A value of- null gets interpreted as matching anything (e.g.- "*" ).
 
- 
StringRangeConstructor.- Parameters:
- e- The parsed string range element.
 
 
- 
- 
Method Details- 
getNameReturns the name of this string range.This is the primary value minus the quality or other parameters. - Returns:
- The name of this string range.
 
- 
getQValueReturns the'q' (quality) value for this type, as described in Section 3.9 of RFC2616.The quality value is a float between 0.0 (unacceptable) and1.0 (most acceptable).If 'q' value doesn't make sense for the context (e.g. this range was extracted from a "content-*" header, as opposed to"accept-*" header, its value will always be"1" .- Returns:
- The 'q' value for this type, never null .
 
- 
getExtensionsReturns the optional set of custom extensions defined for this type.Values are lowercase and never null .- Returns:
- The optional list of extensions, never null .
 
- 
forEachExtensionPerforms an action on the optional set of custom extensions defined for this type.- Parameters:
- action- The action to perform.
- Returns:
- This object.
 
- 
equalsReturnstrue if the specified object is also aStringRange , and has the same qValue, type, parameters, and extensions.
- 
hashCodeReturns a hash based on this instance'smedia-type .
- 
matchPerforms a match of this string range against the specified name.- Parameters:
- name- The name being compared against.
- Returns:
- 0 = no match, 100 = perfect match, 50 = meta-match.
 
- 
toString
 
-