/** * Indicates if the current variant includes the given variant. * * @param other * The other variant. * @return True if the current variant includes the other. */ public boolean includes(Variant other) { boolean result = other != null; // Compare the character set if (result) { result = (getCharacterSet() == null) || getCharacterSet().includes(other.getCharacterSet()); } // Compare the media type if (result) { result = (getMediaType() == null) || getMediaType().includes(other.getMediaType()); } // Compare the languages if (result) { result = (getLanguages().isEmpty()) || getLanguages().contains(Language.ALL) || getLanguages().containsAll(other.getLanguages()); } return result; }
|| getCharacterSet().includes(other.getCharacterSet());