From f9c49997cfd08b503cd256db145a670090165933 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 17 Apr 2012 17:46:19 +0200 Subject: [PATCH] Add base class, let all other containers extend the base class. --- .../pterodactylus/demoscenemusic/data/Artist.java | 9 ++---- .../pterodactylus/demoscenemusic/data/Base.java | 37 ++++++++++++++++++++++ .../pterodactylus/demoscenemusic/data/Group.java | 9 ++---- .../pterodactylus/demoscenemusic/data/Track.java | 9 ++---- 4 files changed, 43 insertions(+), 21 deletions(-) create mode 100644 src/main/java/net/pterodactylus/demoscenemusic/data/Base.java diff --git a/src/main/java/net/pterodactylus/demoscenemusic/data/Artist.java b/src/main/java/net/pterodactylus/demoscenemusic/data/Artist.java index d31ee31..8a0a5a4 100644 --- a/src/main/java/net/pterodactylus/demoscenemusic/data/Artist.java +++ b/src/main/java/net/pterodactylus/demoscenemusic/data/Artist.java @@ -22,17 +22,12 @@ package net.pterodactylus.demoscenemusic.data; * * @author David ‘Bombe’ Roden */ -public class Artist { +public class Artist extends Base { - private final String id; private String name; public Artist(String id) { - this.id = id; - } - - public String id() { - return id; + super(id); } public String name() { diff --git a/src/main/java/net/pterodactylus/demoscenemusic/data/Base.java b/src/main/java/net/pterodactylus/demoscenemusic/data/Base.java new file mode 100644 index 0000000..9ac65ad --- /dev/null +++ b/src/main/java/net/pterodactylus/demoscenemusic/data/Base.java @@ -0,0 +1,37 @@ +/* + * DemosceneMusic - Base.java - Copyright © 2012 David Roden + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package net.pterodactylus.demoscenemusic.data; + +/** + * TODO + * + * @author David ‘Bombe’ Roden + */ +public class Base { + + private final String id; + + protected Base(String id) { + this.id = id; + } + + public String id() { + return id; + } + +} diff --git a/src/main/java/net/pterodactylus/demoscenemusic/data/Group.java b/src/main/java/net/pterodactylus/demoscenemusic/data/Group.java index 292eb21..d5b6972 100644 --- a/src/main/java/net/pterodactylus/demoscenemusic/data/Group.java +++ b/src/main/java/net/pterodactylus/demoscenemusic/data/Group.java @@ -22,18 +22,13 @@ package net.pterodactylus.demoscenemusic.data; * * @author David ‘Bombe’ Roden */ -public class Group { +public class Group extends Base { - private final String id; private String name; private String url; public Group(String id) { - this.id = id; - } - - public String id() { - return id; + super(id); } public String name() { diff --git a/src/main/java/net/pterodactylus/demoscenemusic/data/Track.java b/src/main/java/net/pterodactylus/demoscenemusic/data/Track.java index 1bb42ca..293c25e 100644 --- a/src/main/java/net/pterodactylus/demoscenemusic/data/Track.java +++ b/src/main/java/net/pterodactylus/demoscenemusic/data/Track.java @@ -22,17 +22,12 @@ package net.pterodactylus.demoscenemusic.data; * * @author David ‘Bombe’ Roden */ -public class Track { +public class Track extends Base { - private final String id; private String name; public Track(String id) { - this.id = id; - } - - public String id() { - return id; + super(id); } public String name() { -- 2.7.4