public class Charset extends java.lang.Object implements java.lang.Comparable<Charset>, Compatible<Charset>
| Constructor and Description |
|---|
Charset(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Charset o) |
boolean |
compatible(Charset other)
Return true if this
Compatible instance
could be safely replaced
with the supplied other
Compatible
Note compatibility is not symmetric
x.compatible(y) does NOT mean
y.compatible(x). |
boolean |
equals(java.lang.Object obj) |
static Charset |
fromContentType(java.lang.String contentTypeHeader) |
int |
hashCode() |
java.lang.String |
name() |
java.lang.String |
toString() |
public java.lang.String name()
public boolean compatible(Charset other)
CompatibleCompatible instance
could be safely replaced
with the supplied other
Compatible
Note compatibility is not symmetric
x.compatible(y) does NOT mean
y.compatible(x). Example:
application/json is compatible with (can replace) application/*
application/* is not compatible with (cannot replace) application/json
wildcard.compatible(json) = true
json.compatible(wildcard) = false
Neither is it transitive.
x.compatible(y) and z.compatible(y)
does not imply z.compatible(z). Example:
application/json is compatible with application/*
application/xml is compatible with application/*
application/xml is not compatible with application/jsoncompatible in interface Compatible<Charset>other - another Compatible instanceCompatible could be replaced by the otherpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic static Charset fromContentType(java.lang.String contentTypeHeader)