protected function convertTypeToMask($value, $type)
    {
        if ($this->forceCaseInsensitivity) {
            $value = $this->encoding ? mb_strtolower($value, $this->encoding) : mb_strtolower($value);
        }

        switch ($type) {
            case FilterOperands::STRING_STARTS:
                $value .= '%';
                break;

            case FilterOperands::STRING_ENDS:
                $value = '%' . $value;
                break;

            case FilterOperands::STRING_CONTAINS:
                $value = '%' . $value . '%';
                break;

            case FilterOperands::STRING_EQUALS:
                break;

            default:
                throw new \InvalidArgumentException('Wrong type constant in string like expression mapper');
        }

        return $value;
    }