public class QEncoding extends Object implements Cloneable, IEncoding
The to string value is calculated when first accessed and cached subsequently. The value is
checked and set atomically. Concurrent access may cause different String objects to be cached and
returned but they will be equal. A happens before relationship is not established by calls to
toString()
.
Constructor and Description |
---|
QEncoding(String encoding,
double qualifier)
Constructor for qualified encodings.
|
Modifier and Type | Method and Description |
---|---|
QEncoding |
clone()
Deprecated.
There is not real value in cloning this object, the only mutable value is the
cached toString value
|
boolean |
equals(Object object) |
double |
getQualifier() |
static List<IEncoding> |
getRequestEncodings(HttpServletRequest request)
Parser for HttpServletRequest to QEncoding
|
int |
hashCode() |
boolean |
isAnyEncoding()
Test to see if the encoding is a wildcard.
|
boolean |
sameEncoding(QEncoding encodingObject)
Method that returns true if the two content types can be matched against one another.
|
String |
toString()
Returns a string representation of the object.
|
public QEncoding(String encoding, double qualifier)
encoding
- The encodingqualifier
- The qualifier of the encodingIllegalArgumentException
- If the encoding is null or if the qualifier is less than zero or greater than onepublic static List<IEncoding> getRequestEncodings(HttpServletRequest request) throws UnParsableHeaderException
request
- The HTTP request to parseUnParsableHeaderException
- If a header cannot be parsedpublic final double getQualifier()
getQualifier
in interface Qualified
public String toString()
The string representation of the object is constructed lazily, it may be initialised multiple times and may not be aware of other threads setting it. The objects returned will be equal regardless of the thread returning the value.
toString
in class Object
Object.toString()
public final boolean sameEncoding(QEncoding encodingObject)
IEncoding
sameEncoding
in interface IEncoding
encodingObject
- Another encodingpublic final boolean isAnyEncoding()
IEncoding
isAnyEncoding
in interface IEncoding
@Deprecated public QEncoding clone()
clone
in class Object
Object.clone()
Copyright © 2016. All Rights Reserved.