public function hasAppliedValue()
    {
        $customFunction = $this->getHasAppliedValueFunction();

        if (is_callable($customFunction)) {
            $result = call_user_func($customFunction, $this);

            if (!is_bool($result)) {
                throw new FilterException('Returned value from callable function must be boolean.');
            }

            return $result;
        }

        $convertedValue = $this->getConvertedValue();

        if (is_array($convertedValue)) {
            return count($convertedValue) > 0;
        }

        if (is_string($convertedValue)) {
            return $convertedValue !== '';
        }

        // Fallback to empty() function by default.
        // If the value is int/float and it is equal to 0, it will be considered that the value has not been applied.
        // To change this behaviour, please override this method.
        return !empty($convertedValue);
    }