Methods Summary |
---|
public android.os.Bundle | asBundle()Converts this object to a bundle for serialization.
return mBundle;
|
public boolean | contains(android.support.v7.media.MediaRouteSelector selector)Returns true if this selector contains all of the capabilities described
by the specified selector.
if (selector != null) {
ensureControlCategories();
selector.ensureControlCategories();
return mControlCategories.containsAll(selector.mControlCategories);
}
return false;
|
private void | ensureControlCategories()
if (mControlCategories == null) {
mControlCategories = mBundle.getStringArrayList(KEY_CONTROL_CATEGORIES);
if (mControlCategories == null || mControlCategories.isEmpty()) {
mControlCategories = Collections.<String>emptyList();
}
}
|
public boolean | equals(java.lang.Object o)
if (o instanceof MediaRouteSelector) {
MediaRouteSelector other = (MediaRouteSelector)o;
ensureControlCategories();
other.ensureControlCategories();
return mControlCategories.equals(other.mControlCategories);
}
return false;
|
public static android.support.v7.media.MediaRouteSelector | fromBundle(android.os.Bundle bundle)Creates an instance from a bundle.
return bundle != null ? new MediaRouteSelector(bundle, null) : null;
|
public java.util.List | getControlCategories()Gets the list of {@link MediaControlIntent media control categories} in the selector.
ensureControlCategories();
return mControlCategories;
|
public boolean | hasControlCategory(java.lang.String category)Returns true if the selector contains the specified category.
if (category != null) {
ensureControlCategories();
final int categoryCount = mControlCategories.size();
for (int i = 0; i < categoryCount; i++) {
if (mControlCategories.get(i).equals(category)) {
return true;
}
}
}
return false;
|
public int | hashCode()
ensureControlCategories();
return mControlCategories.hashCode();
|
public boolean | isEmpty()Returns true if the selector does not specify any capabilities.
ensureControlCategories();
return mControlCategories.isEmpty();
|
public boolean | isValid()Returns true if the selector has all of the required fields.
ensureControlCategories();
if (mControlCategories.contains(null)) {
return false;
}
return true;
|
public boolean | matchesControlFilters(java.util.List filters)Returns true if the selector matches at least one of the specified control filters.
if (filters != null) {
ensureControlCategories();
final int categoryCount = mControlCategories.size();
if (categoryCount != 0) {
final int filterCount = filters.size();
for (int i = 0; i < filterCount; i++) {
final IntentFilter filter = filters.get(i);
if (filter != null) {
for (int j = 0; j < categoryCount; j++) {
if (filter.hasCategory(mControlCategories.get(j))) {
return true;
}
}
}
}
}
}
return false;
|
public java.lang.String | toString()
StringBuilder result = new StringBuilder();
result.append("MediaRouteSelector{ ");
result.append("controlCategories=").append(
Arrays.toString(getControlCategories().toArray()));
result.append(" }");
return result.toString();
|