forked from Fascinated/Bat
add spotify feature
This commit is contained in:
@ -19,7 +19,7 @@ public class ProfileHolder {
|
||||
* Gets a profile for the holder
|
||||
*
|
||||
* @param clazz The class of the profile
|
||||
* @param <T> The type of the profile
|
||||
* @param <T> The type of the profile
|
||||
* @return The profile
|
||||
*/
|
||||
public <T extends Profile> T getProfile(Class<T> clazz) {
|
||||
@ -30,7 +30,7 @@ public class ProfileHolder {
|
||||
Profile profile = profiles.values().stream().filter(p -> p.getClass().equals(clazz)).findFirst().orElse(null);
|
||||
if (profile == null) {
|
||||
try {
|
||||
profile = (Profile) clazz.newInstance();
|
||||
profile = clazz.newInstance();
|
||||
profiles.put(profile.getProfileKey(), profile);
|
||||
} catch (InstantiationException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
|
Reference in New Issue
Block a user