package click.kamil.springstatemachineexporter.analysis.model;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@NoArgsConstructor
public class CallEdge {
    private String targetMethod;
    private List<String> arguments;
    private String receiver;
    private String constraint;
    /**
     * Proven or CHA-refined receiver type FQN when known (field/param type, unique injection,
     * or the concrete impl class of a polymorphic expansion target). Used by pathfinding to
     * prune collaborator template-method fan-out; null means fail open.
     */
    private String receiverTypeFqn;

    public CallEdge(String targetMethod, List<String> arguments) {
        this(targetMethod, arguments, null, null, null);
    }

    public CallEdge(String targetMethod, List<String> arguments, String receiver) {
        this(targetMethod, arguments, receiver, null, null);
    }

    public CallEdge(String targetMethod, List<String> arguments, String receiver, String constraint) {
        this(targetMethod, arguments, receiver, constraint, null);
    }

    public CallEdge(
            String targetMethod,
            List<String> arguments,
            String receiver,
            String constraint,
            String receiverTypeFqn) {
        this.targetMethod = targetMethod;
        this.arguments = arguments;
        this.receiver = receiver;
        this.constraint = constraint;
        this.receiverTypeFqn = receiverTypeFqn;
    }
}
