Fix to convertGet

This commit is contained in:
Olof Larsson 2016-02-02 17:56:57 +01:00
parent 9a50457b3d
commit cd3a9e2bf2

View File

@ -65,6 +65,7 @@ public abstract class SenderEntity<E extends SenderEntity<E>> extends Entity<E>
// CONVENIENCE: DATABASE // CONVENIENCE: DATABASE
// -------------------------------------------- // // -------------------------------------------- //
// GENERIC
public <T> T convertGet(T value, T defaultValue, String permission) public <T> T convertGet(T value, T defaultValue, String permission)
{ {
// Create // Create
@ -77,17 +78,10 @@ public abstract class SenderEntity<E extends SenderEntity<E>> extends Entity<E>
return ret; return ret;
} }
// Boolean specific // BOOLEAN
public boolean convertGet(Boolean wrapper, String permission) public boolean convertGet(Boolean value, String permission)
{ {
// Create return this.convertGet(value, false, permission);
boolean ret = super.convertGet(wrapper);
// Permission Requirement
if (ret && ! PermUtil.has(this.getSender(), permission)) return false;
// Return
return ret;
} }
// -------------------------------------------- // // -------------------------------------------- //