# VersionBuilders.VersionInfo

Artifact: [androidx.wear.protolayout:protolayout-expression](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/expression/VersionBuilders.java+class:androidx.wear.protolayout.expression.VersionBuilders.VersionInfo) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

*** ** * ** ***


```
@RequiresSchemaVersion(major = 1, minor = 0)
public final class VersionBuilders.VersionInfo implements Comparable<VersionBuilders.VersionInfo>
```

<br />

*** ** * ** ***

Version information. This is used to encode the schema version of a payload (e.g. inside of a layout).

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/wear/protolayout/expression/VersionBuilders.VersionInfo.Builder` Builder for `https://developer.android.com/reference/androidx/wear/protolayout/expression/VersionBuilders.VersionInfo` |

| ### Public methods |
|---|---|
| `int` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/VersionBuilders.VersionInfo#compareTo(androidx.wear.protolayout.expression.VersionBuilders.VersionInfo)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/VersionBuilders.VersionInfo other)` |
| `boolean` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/VersionBuilders.VersionInfo#equals(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html obj)` |
| `int` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/VersionBuilders.VersionInfo#getMajor()()` Gets major version. |
| `int` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/VersionBuilders.VersionInfo#getMinor()()` Gets minor version. |
| `int` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/VersionBuilders.VersionInfo#hashCode()()` |
| `@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/wear/protolayout/expression/VersionBuilders.VersionInfo#toString()()` |

## Public methods

### compareTo

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

```
public int compareTo(@NonNull VersionBuilders.VersionInfo other)
```

### equals

```
public boolean equals(@Nullable Object obj)
```

### getMajor

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

```
public int getMajor()
```

Gets major version. Incremented on breaking changes (i.e. compatibility is not guaranteed across major versions).

### getMinor

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

```
public int getMinor()
```

Gets minor version. Incremented on non-breaking changes (e.g. schema additions). Anything consuming a payload can safely consume anything with a lower minor version.

### hashCode

```
public int hashCode()
```

### toString

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