# Single file

Every single file model that is annotated as SingleFile annotation must have fileName and primarySection.

Every single file model must implement FileModel interface.

Methods: serialize() and deserialize(Map\<String, Object> args) are important to Bukkit serialization system.

Example of Single file model:

<pre class="language-java"><code class="lang-java">@SingleFile(fileName = "users_coins.yml", primarySection = "users")
@SerializableAs("UserCoins") //This is alias for Bukkit serialization (optional)
<strong>public class UserCoins implements FileModel, ConfigurationSerializable {
</strong>
    @Id
    private UUID uuid;
    private double coins;

    public UserCoins (String name, double coins) {
        this.name = name;
        this.coins = coins
    }
    
    @Override
    public Dao getDao() {
        return new SingleYamlFileDao(this);
    }
    
    @Override
    @NonNull
    public Map&#x3C;String, Object> serialize() {
        Map&#x3C;String, Object> data = new LinkedHashMap&#x3C;>();

        data.put("uuid", uuid);
        data.put("coins", coins);

        return data;
    }

    public static UserCoins deserialize(Map&#x3C;String, Object> args) {
        return new UserCoins((UUID) args.get("uuid"), 
        (double) args.get("coins"));
    }
}
</code></pre>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://timsixths-plugins.gitbook.io/minigameapi-docs/2.0.0-rc1/basic-features/models/file-model/single-file.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
