package click.kamil.springstatemachineexporter.analysis.flow.eventid;

import java.util.ArrayList;
import java.util.List;

/**
 * Shared poly-publish helpers so ACE (and future publishers) do not reinvent
 * UNIQUE-vs-ENUM_EXPAND adopt rules.
 */
public final class EventIdentityPolyPublish {

    private EventIdentityPolyPublish() {
    }

    /**
     * Mutable copy of expand members when the consult is adoptable as poly widen;
     * otherwise empty list (never UNIQUE proofs).
     */
    public static List<String> adoptExpandOrEmpty(ExpandConsult consult) {
        if (consult == null || !consult.adoptableAsPolyExpand()) {
            return List.of();
        }
        return new ArrayList<>(consult.members());
    }
}
