From f133149321543073bfbe95b93668e3c401c7823d Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Mon, 1 Feb 2016 21:06:07 +0100 Subject: [PATCH] Make boolean convenience based of generic convenience. --- src/com/massivecraft/massivecore/store/Entity.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/com/massivecraft/massivecore/store/Entity.java b/src/com/massivecraft/massivecore/store/Entity.java index baf7f7e5..66f0c398 100644 --- a/src/com/massivecraft/massivecore/store/Entity.java +++ b/src/com/massivecraft/massivecore/store/Entity.java @@ -174,6 +174,7 @@ public class Entity> // CONVENIENCE: DATABASE // -------------------------------------------- // + // GENERIC public T convertGet(T value, T defaultValue) { return value != null ? value : defaultValue; @@ -185,16 +186,15 @@ public class Entity> return Objects.equals(value, defaultValue) ? null : value; } - // Boolean specific - public boolean convertGet(Boolean wrapper) + // BOOLEAN + public boolean convertGet(Boolean value) { - return wrapper != null ? wrapper.booleanValue() : false; + return convertGet(value, false); } - public Boolean convertSet(boolean primitive) + public Boolean convertSet(Boolean value) { - this.changed(); - return primitive ? Boolean.TRUE : null; + return convertSet(value, false); } // -------------------------------------------- //