Commit c373f59b authored by Trisha Gee's avatar Trisha Gee
Browse files

[Ch10c] Adding an ID so we can have a useful Log

parent 01a62ae2
Loading
Loading
Loading
Loading
+23 −23
Changes for src/main/java/ch10c/JukeboxData.java: 23 added lines, 23 removed lines.
Original line number Diff line number Diff line
@@ -12,29 +12,29 @@ public class JukeboxData {
  static class Songs {
    public List<Song> getSongs() {
      return List.of(
        new Song("$10", "Hitchhiker", 140, "Electronic", 2016),
        new Song("Havana", "Camila Cabello", 105, "R&B", 2017),
        new Song("Cassidy", "Grateful Dead", 158, "Rock", 1972),
        new Song("50 ways", "Paul Simon", 102, "Soft Rock", 1975),
        new Song("Hurt", "Nine Inch Nails", 79, "Industrial Rock", 1995),
        new Song("Silence", "Delerium", 98, "Trance", 1999),
        new Song("Hurt", "Johnny Cash", 91, "Soft Rock", 2002),
        new Song("Watercolour", "Pendulum", 174, "Electronic", 2010),
        new Song("The Outsider", "A Perfect Circle", 113, "Alternative Rock", 2004),
        new Song("With a Little Help from My Friends", "The Beatles", 112, "Rock", 1967),
        new Song("Come Together", "The Beatles", 92, "Blues rock", 1968),
        new Song("Come Together", "The Smokin' Mojo Filters", 176, "Rock", 1995),
        new Song("With a Little Help from My Friends", "Joe Cocker", 72, "Rock", 1968),
        new Song("Immigrant Song", "Karen O", 120, "Industrial Rock", 2011),
        new Song("Breathe", "The Prodigy", 130, "Electronic", 1996),
        new Song("What's Going On", "Gaye", 203, "R&B", 1971),
        new Song("Hallucinate", "Dua Lipa", 122, "Pop", 2020),
        new Song("Walk Me Home", "P!nk", 88, "Pop", 2019),
        new Song("I am not a woman, I'm a god", "Halsey", 180, "Alternative Rock", 2021),
        new Song("Pasos de cero", "Pablo Alborán", 99, "Latin", 2014),
        new Song("Nature's Kingdom", "Delerium", 85, "Trance", 2000),
        new Song("Smooth", "Santana", 116, "Latin", 1999),
        new Song("Immigrant song", "Led Zeppelin", 112, "Rock", 1970));
        new Song(1, "$10", "Hitchhiker", 140, "Electronic", 2016),
        new Song(2, "Havana", "Camila Cabello", 105, "R&B", 2017),
        new Song(3, "Cassidy", "Grateful Dead", 158, "Rock", 1972),
        new Song(4, "50 ways", "Paul Simon", 102, "Soft Rock", 1975),
        new Song(5, "Hurt", "Nine Inch Nails", 79, "Industrial Rock", 1995),
        new Song(6, "Silence", "Delerium", 98, "Trance", 1999),
        new Song(7, "Hurt", "Johnny Cash", 91, "Soft Rock", 2002),
        new Song(8, "Watercolour", "Pendulum", 174, "Electronic", 2010),
        new Song(9, "The Outsider", "A Perfect Circle", 113, "Alternative Rock", 2004),
        new Song(10,"With a Little Help from My Friends", "The Beatles", 112, "Rock", 1967),
        new Song(11,"Come Together", "The Beatles", 92, "Blues rock", 1968),
        new Song(12,"Come Together", "The Smokin' Mojo Filters", 176, "Rock", 1995),
        new Song(13,"With a Little Help from My Friends", "Joe Cocker", 72, "Rock", 1968),
        new Song(14,"Immigrant Song", "Karen O", 120, "Industrial Rock", 2011),
        new Song(15,"Breathe", "The Prodigy", 130, "Electronic", 1996),
        new Song(16,"What's Going On", "Gaye", 203, "R&B", 1971),
        new Song(17,"Hallucinate", "Dua Lipa", 122, "Pop", 2020),
        new Song(18,"Walk Me Home", "P!nk", 88, "Pop", 2019),
        new Song(19,"I am not a woman, I'm a god", "Halsey", 180, "Alternative Rock", 2021),
        new Song(20,"Pasos de cero", "Pablo Alborán", 99, "Latin", 2014),
        new Song(21,"Nature's Kingdom", "Delerium", 85, "Trance", 2000),
        new Song(22,"Smooth", "Santana", 116, "Latin", 1999),
        new Song(23, "Immigrant song", "Led Zeppelin", 112, "Rock", 1970));
    }
  }

+11 −0
Changes for src/main/java/ch10c/JukeboxReports.java: 11 added lines, 0 removed lines.
Original line number Diff line number Diff line
package ch10c;

public class JukeboxReports {
  public static void main(String[] args) {

  }

  static void printAllGenres() {

  }
}
+3 −1
Changes for src/main/java/ch10c/Song.java: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
package ch10c;

public class Song {
  private final int id;
  private final String title;
  private final String artist;
  private final int bpm;
  private final String genre;
  private final int year;

  public Song(String title, String artist, int bpm, String genre, int year) {
  public Song(int id, String title, String artist, int bpm, String genre, int year) {
    this.id = id;
    this.title = title;
    this.artist = artist;
    this.bpm = bpm;