{{ header }}package {{ package }};

/** Controls how the visitor affects the conversion pipeline. */
@SuppressWarnings("PMD")
public sealed interface {{ result_type }}
        permits {{ permits | join(', ') }} {

{% for variant in variants %}
{% if variant.payload_field %}
    record {{ variant.name }}(String {{ variant.payload_field }}) implements {{ result_type }} {}

    static {{ result_type }} {{ variant.factory_name }}(String {{ variant.payload_field }}) {
        return new {{ variant.name }}({{ variant.payload_field }});
    }
{% else %}
    record {{ variant.name }}() implements {{ result_type }} {}

    static {{ result_type }} {{ variant.factory_name }}() {
        return new {{ variant.name }}();
    }
{% endif %}
{% endfor %}
}
