private boolean equalsMedia(final MediaList ml) { if ((ml == null) || (getLength() != ml.getLength())) { return false; } for (int i = 0; i < getLength(); i++) { final String m1 = item(i); final String m2 = ml.item(i); if (!LangUtils.equals(m1, m2)) { return false; } } return true; }
public static boolean matchesMedia(final MediaList mediaList, final UserAgentContext rcontext) { if (mediaList == null) { return true; } final int length = mediaList.getLength(); if (length == 0) { return true; } if (rcontext == null) { return false; } for (int i = 0; i < length; i++) { final String mediaName = mediaList.item(i); if (rcontext.isMedia(mediaName)) { return true; } } return false; }