public interface Compatible<T>
| Modifier and Type | Method and Description |
|---|---|
boolean |
compatible(T 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 compatible(T other)
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). 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/jsonother - another Compatible instanceCompatible could be replaced by the other