---
title: "@Version"
---

Marks a config class with a version integer. This can be used for record-keeping, or used to handle breaking updates in a meaningful manner. The version is marked at the top of the .toml file (0 by default) and the serialized version is compared against the annotation version. If a mismatch is detected, the configs `update()` method is called for mismatch handling.

<CodeTabs>

```java !!tabs Java
@Version(version = 1)
public class MyConfig extends Config {
    //constructor goes here
    
    @Override
    public void update(int deserializedVersion) {
        if (deserializedVersion < 1) {
            //do stuff to fix potential issues.
        }
    }
}
```

```kotlin !!tabs Kotlin
@Version(1)
class MyConfig: Config(Identifier("my_id")) {
    
    override fun update(deserializedVersion: Int) {
        if (deserializedVersion < 1) {
            //do stuff to fix potential issues.
        }
    }
}
```

</CodeTabs>

<Callout>
See the documentation page <a target="_blank" rel="noopener" href="https://fzzyhmstrs.github.io/fconfig/-fzzy%20-config/me.fzzyhmstrs.fzzy_config.annotations/-version/index.html">here 🗗</a>
</Callout>