# CustomFilter

Artifact: [androidx.test:runner](https://developer.android.com/jetpack/androidx/releases/test) [View Source](https://cs.android.com/search?q=file:androidx/test/filters/CustomFilter.java+class:androidx.test.filters.CustomFilter)

*** ** * ** ***


```
@Retention(value = RetentionPolicy.RUNTIME)
@Target(value = [ElementType.ANNOTATION_TYPE])
public annotation CustomFilter
```

<br />

*** ** * ** ***

Custom test filters for Android tests.

To add a custom filter to your android test, create an annotation and use @CustomFilter to specify a filter implementation class, which must extend `https://developer.android.com/reference/androidx/test/filters/AbstractFilter` and handle the test annotation that @CustomFilter is being added to. For example:

```
public @interface MyCustomFilterAnnotation {}
```

## Summary

| ### Public methods |
|---|---|
| `abstract https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/androidx/test/filters/AbstractFilter>` | `https://developer.android.com/reference/androidx/test/filters/CustomFilter#filterClass()()` |

## Public methods

### filterClass

```
public abstract Class<AbstractFilter> filterClass()
```