# Document.StringProperty.DefaultSerializer

Artifact: [androidx.appsearch:appsearch](https://developer.android.com/jetpack/androidx/releases/appsearch) [View Source](https://cs.android.com/search?q=file:androidx/appsearch/annotation/Document.java+class:androidx.appsearch.annotation.Document.StringProperty.DefaultSerializer) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

*** ** * ** ***


```
public final class Document.StringProperty.DefaultSerializer implements StringSerializer<String>
```

<br />

*** ** * ** ***

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/appsearch/annotation/Document.StringProperty.DefaultSerializer#DefaultSerializer()()` |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/annotation/Document.StringProperty.DefaultSerializer#deserialize(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html string)` Deserializes a `https://developer.android.com/reference/androidx/appsearch/app/StringSerializer` from a String. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/annotation/Document.StringProperty.DefaultSerializer#serialize(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html instance)` Serializes a `https://developer.android.com/reference/androidx/appsearch/app/StringSerializer` to a String. |

## Public constructors

### DefaultSerializer

Added in 1.1.0

```
public DefaultSerializer()
```

## Public methods

### deserialize

```
public @NonNull String deserialize(@NonNull String string)
```

Deserializes a `https://developer.android.com/reference/androidx/appsearch/app/StringSerializer` from a String. Returns null if deserialization failed.

### serialize

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
public @NonNull String serialize(@NonNull String instance)
```

Serializes a `https://developer.android.com/reference/androidx/appsearch/app/StringSerializer` to a String.