Add style creator.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 19 Apr 2012 15:00:41 +0000 (17:00 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 19 Apr 2012 15:00:41 +0000 (17:00 +0200)
src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java

index 9ec6d73..c0d458f 100644 (file)
@@ -47,6 +47,7 @@ public class DataManager {
        private final ObjectCreator<Artist> artistCreator = new ArtistCreator();
        private final ObjectCreator<Group> groupCreator = new GroupCreator();
        private final ObjectCreator<Track> trackCreator = new TrackCreator();
+       private final ObjectCreator<Style> styleCreator = new StyleCreator();
 
        private final Database database;
 
@@ -256,4 +257,16 @@ public class DataManager {
 
        }
 
+       private class StyleCreator implements ObjectCreator<Style> {
+
+               /**
+                * {@inheritDoc}
+                */
+               @Override
+               public Style createObject(ResultSet resultSet) throws SQLException {
+                       return new DefaultStyle(resultSet.getString("STYLES.ID")).name(resultSet.getString("STYLES.NAME"));
+               }
+
+       }
+
 }