import java.io.Serializable;

/** Una clase común (no un record) con la misma validación que Song. */
public class PlainSong implements Serializable {
    private static final long serialVersionUID = 1L;

    private final String title;
    private final int seconds;

    public PlainSong(String title, int seconds) {
        if (seconds <= 0) {
            throw new IllegalArgumentException("duración inválida: " + seconds);
        }
        this.title = title;
        this.seconds = seconds;
    }

    public int seconds() {
        return seconds;
    }

    @Override
    public String toString() {
        return "PlainSong[" + title + ", " + seconds + "]";
    }
}
