From 7111cd7fbdb9d40d6021e299b24fda6a1d67dde9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 26 Apr 2012 15:39:55 +0200 Subject: [PATCH] Implement levels in default implementation. --- .../pterodactylus/demoscenemusic/data/DefaultUser.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/main/java/net/pterodactylus/demoscenemusic/data/DefaultUser.java b/src/main/java/net/pterodactylus/demoscenemusic/data/DefaultUser.java index ea2959c..f8fe1b6 100644 --- a/src/main/java/net/pterodactylus/demoscenemusic/data/DefaultUser.java +++ b/src/main/java/net/pterodactylus/demoscenemusic/data/DefaultUser.java @@ -59,6 +59,23 @@ public class DefaultUser extends DefaultBase implements User { * {@inheritDoc} */ @Override + public int getLevel() { + return Default.forNull(getValue("level", Integer.class).get(), 0); + } + + /** + * {@inheritDoc} + */ + @Override + public User setLevel(int level) { + getValue("level", Integer.class).set(level); + return this; + } + + /** + * {@inheritDoc} + */ + @Override @SuppressWarnings("unchecked") public Collection getOpenIds() { return getValue("openIds", Collection.class).get(); -- 2.7.4