# Collector.Characteristics

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# Characteristics

```
class Characteristics
```

|---|---|------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                              |||
| ↳ | [kotlin.Enum](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html)\<[java.util.stream.Collector.Characteristics](https://developer.android.com/reference/kotlin/java/util/stream/Collector.Characteristics#)\> ||
|   | ↳ | [java.util.stream.Collector.Characteristics](https://developer.android.com/reference/kotlin/java/util/stream/Collector.Characteristics#) |

|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known Direct Subclasses [Collector.Characteristics.CONCURRENT](https://developer.android.com/reference/kotlin/java/util/stream/Collector.Characteristics#ENUM_VALUE:CONCURRENT),[Collector.Characteristics.IDENTITY_FINISH](https://developer.android.com/reference/kotlin/java/util/stream/Collector.Characteristics#ENUM_VALUE:IDENTITY_FINISH),[Collector.Characteristics.UNORDERED](https://developer.android.com/reference/kotlin/java/util/stream/Collector.Characteristics#ENUM_VALUE:UNORDERED) |-------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Collector.Characteristics.CONCURRENT](https://developer.android.com/reference/kotlin/java/util/stream/Collector.Characteristics#ENUM_VALUE:CONCURRENT)           | Indicates that this collector is*concurrent*, meaning that the result container can support the accumulator function being called concurrently with the same result container from multiple threads. | | [Collector.Characteristics.IDENTITY_FINISH](https://developer.android.com/reference/kotlin/java/util/stream/Collector.Characteristics#ENUM_VALUE:IDENTITY_FINISH) | Indicates that the finisher function is the identity function and can be elided.                                                                                                                     | | [Collector.Characteristics.UNORDERED](https://developer.android.com/reference/kotlin/java/util/stream/Collector.Characteristics#ENUM_VALUE:UNORDERED)             | Indicates that the collection operation does not commit to preserving the encounter order of input elements.                                                                                         | |

Characteristics indicating properties of a`Collector`, which can be used to optimize reduction implementations.

## Summary

|                                                                                                                                                              Enum values                                                                                                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [CONCURRENT](https://developer.android.com/reference/kotlin/java/util/stream/Collector.Characteristics#ENUM_VALUE:CONCURRENT) Indicates that this collector is*concurrent*, meaning that the result container can support the accumulator function being called concurrently with the same result container from multiple threads. |
| [IDENTITY_FINISH](https://developer.android.com/reference/kotlin/java/util/stream/Collector.Characteristics#ENUM_VALUE:IDENTITY_FINISH) Indicates that the finisher function is the identity function and can be elided.                                                                                                           |
| [UNORDERED](https://developer.android.com/reference/kotlin/java/util/stream/Collector.Characteristics#ENUM_VALUE:UNORDERED) Indicates that the collection operation does not commit to preserving the encounter order of input elements.                                                                                           |

## Enum values

### CONCURRENT

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
enum val CONCURRENT : Collector.Characteristics
```

Indicates that this collector is*concurrent*, meaning that the result container can support the accumulator function being called concurrently with the same result container from multiple threads.

If a`CONCURRENT`collector is not also`UNORDERED`, then it should only be evaluated concurrently if applied to an unordered data source.  

### IDENTITY_FINISH

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
enum val IDENTITY_FINISH : Collector.Characteristics
```

Indicates that the finisher function is the identity function and can be elided. If set, it must be the case that an unchecked cast from A to R will succeed.  

### UNORDERED

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
enum val UNORDERED : Collector.Characteristics
```

Indicates that the collection operation does not commit to preserving the encounter order of input elements. (This might be true if the result container has no intrinsic order, such as a[Set](https://developer.android.com/reference/kotlin/java/util/Set.html#).)