org.torweg.pulse.service.request
Class AcceptLanguages.Value
java.lang.Object
org.torweg.pulse.service.request.AcceptLanguages.Value
- All Implemented Interfaces:
- java.lang.Comparable<AcceptLanguages.Value>
- Enclosing class:
- AcceptLanguages
public static final class AcceptLanguages.Value
- extends java.lang.Object
- implements java.lang.Comparable<AcceptLanguages.Value>
a single comparable accept-language value.
|
Constructor Summary |
protected |
AcceptLanguages.Value(java.lang.String lang,
double q,
int p)
creates a new value with the given quality 1. |
protected |
AcceptLanguages.Value(java.lang.String lang,
int p)
creates a new value with the default quality 1. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
AcceptLanguages.Value
protected AcceptLanguages.Value(java.lang.String lang,
int p)
- creates a new value with the default quality 1.
- Parameters:
lang - the languagep - the position
AcceptLanguages.Value
protected AcceptLanguages.Value(java.lang.String lang,
double q,
int p)
- creates a new value with the given quality 1.
- Parameters:
lang - the languageq - the qualityp - the position
getLocale
public java.util.Locale getLocale()
- Returns:
- the locale
getQuality
public double getQuality()
- Returns:
- the quality
compareTo
public int compareTo(AcceptLanguages.Value o)
- Specified by:
compareTo in interface java.lang.Comparable<AcceptLanguages.Value>
- Parameters:
o - the value to compare with
- Returns:
- a negative integer, zero, or a positive integer as this
object is less than, equal to, or greater than the specified
object.
- See Also:
Comparable.compareTo(java.lang.Object)
hashCode
public int hashCode()
- Overrides:
hashCode in class java.lang.Object
- Returns:
- the hash code for the value
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals in class java.lang.Object
- Parameters:
obj - the object to check for equality
- Returns:
- whether the values are equal
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
- Returns:
- a string representation of the value