public final void setOwner(ChunkyObject object, Boolean keepChildren, boolean clearPermissions) {
        if (owner != null) {
            if (keepChildren)
                owner.removeOwnable(this);
            else
                owner.removeOwnableAndTakeChildren(this);
        }
        else if(!keepChildren) {
            this.removeChildren();
        }
        if (object != null) {
            if (object.addOwnable(this))
                owner = object;
        } else {
            owner = null;
        }
        if (clearPermissions) {
            ChunkyManager.getAllPermissions(this).clear();
            DatabaseManager.getDatabase().removeAllPermissions(this);
        }
    }