# AppFunctionStringTypeMetadata

Artifact: [androidx.appfunctions:appfunctions](https://developer.android.com/jetpack/androidx/releases/appfunctions) [View Source](https://cs.android.com/search?q=file:androidx/appfunctions/metadata/AppFunctionDataTypeMetadata.kt+class:androidx.appfunctions.metadata.AppFunctionStringTypeMetadata) Added in [1.0.0-rc01](https://developer.android.com/jetpack/androidx/releases/appfunctions#1.0.0-rc01)

*** ** * ** ***


```
class AppFunctionStringTypeMetadata : AppFunctionDataTypeMetadata
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.appfunctions.metadata.AppFunctionDataTypeMetadata](https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionDataTypeMetadata) ||
|   | ↳ | [androidx.appfunctions.metadata.AppFunctionStringTypeMetadata](https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata) |

*** ** * ** ***

Defines the schema of a string data type.

Corresponds to `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html`.

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata#FORMAT_URI()` The format string representing a URI value. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata#AppFunctionStringTypeMetadata(kotlin.Boolean,kotlin.String,kotlin.collections.Set,kotlin.collections.List,kotlin.String)( isNullable: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, description: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, enumValues: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html>?, patternMatchers: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/android/os/PatternMatcher.html>?, format: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html? )` |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata#toString()()` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html>?` | `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata#enumValues()` Defines the complete set of allowed string values accepted by this data type. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata#format()` The semantic format description for string values (e.g., `"uri"`). |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/android/os/PatternMatcher.html>?` | `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata#patternMatchers()` The patternMatchers that string values must match. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata#regexPattern()` A regular expression equivalent to `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata#patternMatchers()`, or `null` if `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata#patternMatchers()` is null or contains a type that this library version cannot convert (for example, a type added in a newer SDK). |

### Inherited properties

From [androidx.appfunctions.metadata.AppFunctionDataTypeMetadata](https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionDataTypeMetadata) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionDataTypeMetadata#description()`

A description of the data type and its intended use.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionDataTypeMetadata#isNullable()`

Whether the data type is nullable.

## Constants

### FORMAT_URI

```
const val FORMAT_URI: String
```

The format string representing a URI value.

## Public constructors

### AppFunctionStringTypeMetadata

```
AppFunctionStringTypeMetadata(
    isNullable: Boolean,
    description: String = "",
    enumValues: Set<String>? = null,
    patternMatchers: List<PatternMatcher>? = null,
    format: String? = null
)
```

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

```
open fun hashCode(): Int
```

### toString

```
open fun toString(): String
```

## Public properties

### enumValues

Added in [1.0.0-rc01](https://developer.android.com/jetpack/androidx/releases/appfunctions#1.0.0-rc01)

```
val enumValues: Set<String>?
```

Defines the complete set of allowed string values accepted by this data type.

If null, all values are allowed, otherwise it must be non-empty.

If any of the values carry special meaning (e.g., `"AUTO"` means automatic mode), such meanings should be documented clearly in the corresponding property, parameter, or function return KDoc.

### format

Added in [1.0.0-rc01](https://developer.android.com/jetpack/androidx/releases/appfunctions#1.0.0-rc01)

```
val format: String?
```

The semantic format description for string values (e.g., `"uri"`).

Provides a hint describing the expected format or semantic representation of the string values. A `null` value indicates that no format description is set.

### patternMatchers

Added in [1.0.0-rc01](https://developer.android.com/jetpack/androidx/releases/appfunctions#1.0.0-rc01)

```
val patternMatchers: List<PatternMatcher>?
```

The patternMatchers that string values must match.

If null, no pattern constraint is applied, otherwise it must be non-empty and string values accepted by this data type must match at least one of these `https://developer.android.com/reference/android/os/PatternMatcher.html`s.

### regexPattern

Added in [1.0.0-rc01](https://developer.android.com/jetpack/androidx/releases/appfunctions#1.0.0-rc01)

```
val regexPattern: String?
```

A regular expression equivalent to `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata#patternMatchers()`, or `null` if `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata#patternMatchers()` is null or contains a type that this library version cannot convert (for example, a type added in a newer SDK).

Combines all `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata#patternMatchers()` into a single expression joined as alternatives (logical OR), so it matches a string value if and only if at least one of `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata#patternMatchers()` matches it. The expression uses ECMA-262 regular expression syntax and is derived from `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata#patternMatchers()` rather than stored.

This is intended for describing the constraint to non-Android consumers. Do not use it to validate values: evaluating a regular expression derived from untrusted metadata risks catastrophic backtracking (ReDoS) and regex dialect mismatches. An `https://developer.android.com/reference/kotlin/androidx/appfunctions/AppFunctionData` built with this metadata already validates string values against `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata#patternMatchers()`.