<?php

namespace DropshippingExportFreeVendor\WPDesk\Library\DropshippingExport\ConditionalLogic\Conditions;

use DropshippingExportFreeVendor\WPDesk\Library\DropshippingExport\ConditionalLogic\Conditions\Abstraction\Condition;
use DropshippingExportFreeVendor\WPDesk\Library\DropshippingExport\ConditionalLogic\Conditions\Abstraction\ConditionOperator;
use DropshippingExportFreeVendor\WPDesk\Library\DropshippingExport\ConditionalLogic\Conditions\Abstraction\ConditionWithValue;
class NotEqualCondition implements Condition, ConditionWithValue, ConditionOperator
{
    public const SEPARATOR = '|';
    private string $value = '';
    public function is_valid($field_value): bool
    {
        foreach ($this->get_values() as $value) {
            if (strval($field_value) != strval($value)) {
                return \true;
            }
        }
        return \false;
    }
    public static function get_operator(): string
    {
        return '!=';
    }
    public static function get_operator_value($value): string
    {
        return $value;
    }
    public static function get_name(): string
    {
        return 'not_equal';
    }
    public static function get_nice_name(): string
    {
        return __('is not equal', 'dropshipping-export-free');
    }
    public function set_value(string $value)
    {
        $this->value = $value;
    }
    public function get_values(): array
    {
        return \explode(self::SEPARATOR, $this->value);
    }
    public function has_multiple_values(): bool
    {
        return count($this->get_values()) > 1;
    }
}
