Annotation Type YamlFile


  • @Retention(RUNTIME)
    @Target(TYPE)
    public @interface YamlFile
    Identifies a file that can be saved and loaded from a YAML file. Requires a constructor with no arguments present.

    Not to be confused with EmbeddedYaml, which specifies custom types that can be embedded within this file.

    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      boolean convertToSnakeCase
      Whether to convert fields to snake_case
      @NotNull java.lang.String header
      Header to include at the top of the generated file
      @NotNull java.lang.String versionField
      The field to use as a key for the version of the file
      int versionNumber
      The current version number of the file.
    • Element Detail

      • convertToSnakeCase

        boolean convertToSnakeCase
        Whether to convert fields to snake_case

        Default: true

        Returns:
        Whether to convert fields to snake_case
        Default:
        true
      • header

        @NotNull
        @NotNull java.lang.String header
        Header to include at the top of the generated file
        Returns:
        Header to include at the top of the generated file
        Default:
        ""
      • versionField

        @NotNull
        @NotNull java.lang.String versionField
        The field to use as a key for the version of the file

        If set to "" (empty string), the version will be omitted from the file

        Default: ""

        Returns:
        The field to use as a key for the version of the file
        Default:
        ""
      • versionNumber

        int versionNumber
        The current version number of the file. This will be written to the config to the field specified by versionField(). If versionField() is "", this will be omitted from the config.

        Default: 1

        Returns:
        The current version number of the file
        Default:
        1