# 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)

*** ** * ** ***


```
public final class AppFunctionStringTypeMetadata extends AppFunctionDataTypeMetadata
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.appfunctions.metadata.AppFunctionDataTypeMetadata](https://developer.android.com/reference/androidx/appfunctions/metadata/AppFunctionDataTypeMetadata) ||
|   | ↳ | [androidx.appfunctions.metadata.AppFunctionStringTypeMetadata](https://developer.android.com/reference/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 |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata#FORMAT_URI()` The format string representing a URI value. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata#AppFunctionStringTypeMetadata(kotlin.Boolean,kotlin.String,kotlin.collections.Set,kotlin.collections.List,kotlin.String)( boolean isNullable, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html description, https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html> enumValues, https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/PatternMatcher.html> patternMatchers, https://developer.android.com/reference/java/lang/String.html format )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html>` | `https://developer.android.com/reference/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata#getEnumValues()()` Defines the complete set of allowed string values accepted by this data type. |
| `final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata#getFormat()()` The semantic format description for string values (e.g., `"uri"`). |
| `final https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/PatternMatcher.html>` | `https://developer.android.com/reference/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata#getPatternMatchers()()` The patternMatchers that string values must match. |
| `final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata#getRegexPattern()()` A regular expression equivalent to `https://developer.android.com/reference/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata#patternMatchers()`, or `null` if `https://developer.android.com/reference/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). |
| `int` | `https://developer.android.com/reference/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata#hashCode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata#toString()()` |

### Inherited methods

From [androidx.appfunctions.metadata.AppFunctionDataTypeMetadata](https://developer.android.com/reference/androidx/appfunctions/metadata/AppFunctionDataTypeMetadata) `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/appfunctions/metadata/AppFunctionDataTypeMetadata#getDescription()()`

A description of the data type and its intended use.
`final boolean` `https://developer.android.com/reference/androidx/appfunctions/metadata/AppFunctionDataTypeMetadata#isNullable()()`

Whether the data type is nullable.

## Constants

### FORMAT_URI

```
public static final @NonNull String FORMAT_URI
```

The format string representing a URI value.

## Public constructors

### AppFunctionStringTypeMetadata

```
public AppFunctionStringTypeMetadata(
    boolean isNullable,
    @NonNull String description,
    Set<@NonNull String> enumValues,
    List<@NonNull PatternMatcher> patternMatchers,
    String format
)
```

## Public methods

### equals

```
public boolean equals(Object other)
```

### getEnumValues

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

```
public final Set<@NonNull String> getEnumValues()
```

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.

### getFormat

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

```
public final String getFormat()
```

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.

### getPatternMatchers

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

```
public final List<@NonNull PatternMatcher> getPatternMatchers()
```

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.

### getRegexPattern

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

```
public final String getRegexPattern()
```

A regular expression equivalent to `https://developer.android.com/reference/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata#patternMatchers()`, or `null` if `https://developer.android.com/reference/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/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/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata#patternMatchers()` matches it. The expression uses ECMA-262 regular expression syntax and is derived from `https://developer.android.com/reference/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/androidx/appfunctions/AppFunctionData` built with this metadata already validates string values against `https://developer.android.com/reference/androidx/appfunctions/metadata/AppFunctionStringTypeMetadata#patternMatchers()`.

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```