package p.studio.debug.runtime;

public record StudioRuntimeHandshakeResult(
        boolean success,
        StudioRuntimeDebugConnectionSettings settings,
        Integer protocolVersion,
        String runtimeVersion,
        String failureMessage) {

    public static StudioRuntimeHandshakeResult success(
            final StudioRuntimeDebugConnectionSettings settings,
            final int protocolVersion,
            final String runtimeVersion) {
        return new StudioRuntimeHandshakeResult(true, settings, protocolVersion, runtimeVersion, null);
    }

    public static StudioRuntimeHandshakeResult failure(
            final StudioRuntimeDebugConnectionSettings settings,
            final String failureMessage) {
        return new StudioRuntimeHandshakeResult(false, settings, null, null, failureMessage);
    }
}
