AppFunctionStringTypeMetadata


public final class AppFunctionStringTypeMetadata extends AppFunctionDataTypeMetadata


Defines the schema of a string data type.

Corresponds to kotlin.String.

Summary

Constants

static final @NonNull String

The format string representing a URI value.

Public constructors

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

Public methods

boolean
equals(Object other)
final Set<@NonNull String>

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

final String

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

final List<@NonNull PatternMatcher>

The patternMatchers that string values must match.

final String

A regular expression equivalent to patternMatchers, or null if patternMatchers is null or contains a type that this library version cannot convert (for example, a type added in a newer SDK).

int
@NonNull String

Inherited methods

From androidx.appfunctions.metadata.AppFunctionDataTypeMetadata
final @NonNull String

A description of the data type and its intended use.

final boolean

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-beta01
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-beta01
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-beta01
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 PatternMatchers.

getRegexPattern

Added in 1.0.0-beta01
public final String getRegexPattern()

A regular expression equivalent to patternMatchers, or null if patternMatchers is null or contains a type that this library version cannot convert (for example, a type added in a newer SDK).

Combines all patternMatchers into a single expression joined as alternatives (logical OR), so it matches a string value if and only if at least one of patternMatchers matches it. The expression uses ECMA-262 regular expression syntax and is derived from 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 androidx.appfunctions.AppFunctionData built with this metadata already validates string values against patternMatchers.

hashCode

public int hashCode()

toString

public @NonNull String toString()