# AbstractFilter

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

*** ** * ** ***


```
abstract class AbstractFilter : Filter
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [org.junit.runner.manipulation.Filter](https://junit.org/junit4/javadoc/latest/org/junit/runner/manipulation/Filter.html) ||
|   | ↳ | [androidx.test.filters.AbstractFilter](https://developer.android.com/reference/kotlin/androidx/test/filters/AbstractFilter) |

*** ** * ** ***

Helper parent class for `https://junit.org/junit4/javadoc/latest/org/junit/runner/manipulation/Filter.html` that allows suites to run if any child matches.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/test/filters/AbstractFilter#AbstractFilter()()` |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/filters/AbstractFilter#shouldRun(org.junit.runner.Description)(description: https://junit.org/junit4/javadoc/latest/org/junit/runner/Description.html!)` |

| ### Protected functions |
|---|---|
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/filters/AbstractFilter#evaluateTest(org.junit.runner.Description)(description: https://junit.org/junit4/javadoc/latest/org/junit/runner/Description.html!)` Determine if given test description matches filter. |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-annotation/index.html!>!` | `https://developer.android.com/reference/kotlin/androidx/test/filters/AbstractFilter#getClassAnnotations(org.junit.runner.Description)(description: https://junit.org/junit4/javadoc/latest/org/junit/runner/Description.html!)` Get a list of class annotations that are annotated with @CustomFilter with this class as the filter class. |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-annotation/index.html!>!` | `https://developer.android.com/reference/kotlin/androidx/test/filters/AbstractFilter#getMethodAnnotations(org.junit.runner.Description)(description: https://junit.org/junit4/javadoc/latest/org/junit/runner/Description.html!)` Get a list of method annotations that are annotated with @CustomFilter with this class as the filter class. |

| ### Inherited Constants |
|---|
| From [org.junit.runner.manipulation.Filter](https://junit.org/junit4/javadoc/latest/org/junit/runner/manipulation/Filter.html) |---|---| | `const https://junit.org/junit4/javadoc/latest/org/junit/runner/manipulation/Filter.html!` | `https://junit.org/junit4/javadoc/latest/org/junit/runner/manipulation/Filter.html#ALL` | |

| ### Inherited functions |
|---|
| From [org.junit.runner.manipulation.Filter](https://junit.org/junit4/javadoc/latest/org/junit/runner/manipulation/Filter.html) |---|---| | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://junit.org/junit4/javadoc/latest/org/junit/runner/manipulation/Filter.html#apply-java.lang.Object-(child: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` | | `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://junit.org/junit4/javadoc/latest/org/junit/runner/manipulation/Filter.html#describe--()` | | `https://junit.org/junit4/javadoc/latest/org/junit/runner/manipulation/Filter.html!` | `https://junit.org/junit4/javadoc/latest/org/junit/runner/manipulation/Filter.html#intersect-org.junit.runner.manipulation.Filter-(second: https://junit.org/junit4/javadoc/latest/org/junit/runner/manipulation/Filter.html!)` | | `java-static https://junit.org/junit4/javadoc/latest/org/junit/runner/manipulation/Filter.html!` | `https://junit.org/junit4/javadoc/latest/org/junit/runner/manipulation/Filter.html#matchMethodDescription-org.junit.runner.Description-(desiredDescription: https://junit.org/junit4/javadoc/latest/org/junit/runner/Description.html!)` | |

## Public constructors

### AbstractFilter

```
AbstractFilter()
```

## Public functions

### shouldRun

```
fun shouldRun(description: Description!): Boolean
```

## Protected functions

### evaluateTest

```
protected abstract fun evaluateTest(description: Description!): Boolean
```

Determine if given test description matches filter.

| Parameters |
|---|---|
| `description: https://junit.org/junit4/javadoc/latest/org/junit/runner/Description.html!` | the `https://junit.org/junit4/javadoc/latest/org/junit/runner/Description.html` describing the test |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if matched |

### getClassAnnotations

```
protected fun getClassAnnotations(description: Description!): (Mutable)List<Annotation!>!
```

Get a list of class annotations that are annotated with @CustomFilter with this class as the filter class.

| Parameters |
|---|---|
| `description: https://junit.org/junit4/javadoc/latest/org/junit/runner/Description.html!` | the `https://junit.org/junit4/javadoc/latest/org/junit/runner/Description.html` describing the test |

| Returns |
|---|---|
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-annotation/index.html!>!` | a list of annotations on the test class that are handled by this filter |

### getMethodAnnotations

```
protected fun getMethodAnnotations(description: Description!): (Mutable)List<Annotation!>!
```

Get a list of method annotations that are annotated with @CustomFilter with this class as the filter class.

| Parameters |
|---|---|
| `description: https://junit.org/junit4/javadoc/latest/org/junit/runner/Description.html!` | the `https://junit.org/junit4/javadoc/latest/org/junit/runner/Description.html` describing the test |

| Returns |
|---|---|
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-annotation/index.html!>!` | a list of annotations on methods that are handled by this filter |