@param ComplexValueInterface $other

@return boolean true if the other value object is of the same type and has the same values
509022
public function similarTo(ComplexValueInterface $other)
    {
        if (get_class($this) !== get_class($other)) {
            return false;
        }

        return $this->similarToArray($other->toNative());
    }
596318
protected function matches($other): bool
    {
        $this->resetProblems();
        if (!($other instanceof EventSubscriberInterface)) {
            $this->addProblem('Subscriber must implement \Symfony\Component\EventDispatcher\EventSubscriberInterface.');
            return false;
        }
        $subscribedEvents = call_user_func(array(get_class($other), 'getSubscribedEvents'));
        if (!is_array($subscribedEvents)) {
            $this->addProblem('getSubscribedEvents() must return an array.');
            return false;
        }
        foreach ($subscribedEvents as $event => $subscription) {
            /* @var $event string */
            /* @var $subscription mixed|string|array */
            $this->checkListener($other, $event, $subscription);
        }
        return !$this->hasProblems();
    }
728643
public function Compare( $other )
	{
		// BMS 2019-04-28
		// Probably need to do this for all other numeric types and the boolean
	    switch ( $other->GetValueCode() )
	    {
			case DecimalProxyFactory::Code:
				return 1;

	    	case StringProxyFactory::Code:
				return 0;

	        default:
	        	return -2;
	    }

		if ( $other->GetValueCode() == StringProxyFactory::Code )
	        return 0;
	    return -2;
	}
179954
public function equals( $other )
	{
		try
		{
			return $this->qnameValueHash == $other->qnameValueHash ||
				( $this->localName == $other->localName && $this->namespaceURI == $other->namespaceURI );
		}
		catch( \Exception $ex )
		{
			return false;
		}
	}
124435
public function notSame($anotherValue)
    {
        if (is_object($anotherValue)) {
            throw new InvalidNotObjectException('anotherValue');
        }

        if ($this->value === $anotherValue) {
            throw new InvalidNotSameValueException($this->name, $this->value);
        }

        return $this;
    }
1029580
public function sameValueAs(ValueObjectInterface $stringLiteral)
    {
        if (false === Util::classEquals($this, $stringLiteral)) {
            return false;
        }

        return $this->toNative() === $stringLiteral->toNative();
    }
749708
public function sameValueAs(ValueObjectInterface $keyValuePair)
    {
        if (false === Util::classEquals($this, $keyValuePair)) {
            return false;
        }

        return $this->getKey()->sameValueAs($keyValuePair->getKey()) && $this->getValue()->sameValueAs($keyValuePair->getValue());
    }
339192
protected function matches($other): bool
    {
        if (is_array($other)) {
            $success = null;
            foreach ($other as $item) {
                $currentSuccess = $this->matchesSection($item);
                $success = ($success === null ? $currentSuccess : $success || $currentSuccess);
            }
            return !empty($success);
        } else {
            return $this->matchesSection($other);
        }
    }
63461
public function equals(Type $other)
    {
        $result = $other->isAssignableFrom($this) && $this->isAssignableFrom($other);
        $result2 = $this->getName() === $other->getName();
        
        //Are there any types which do not have the same name, but are assignable to each other?
        //(United types are sorted by their names)
        if ($result !== $result2)
            throw new \Exception("This should not happen - please report a bug!");
        
        return $result;
    }
411390
public function gt($other)
    {
        if (!($other instanceof self)) {
            $other = new BigInt($other);
        }
        return ($this->compare($other) > 0);
    }
203236
public function equals($other) {
		if ($other instanceof UrlHost) {
			return ($this->isEmpty() && $other->isEmpty()) || ($this->str === $other->str);
		}
		if (is_null($other)) {
			return is_null($this->str);
		}
		if (is_string($other)) {
			return $this->__toString() === $other;
		}
		return false;
	}
612567
public function equal($other)
    {
        $this->doCheck(function ($value) use ($other) {
            $this->throwExceptionIfFalse(
                $value == $other,
                'Value "%s" is not equal to "%s"', $value, $other
            );
        });

        return $this;
    }
236531
public function sameValueAs(ValueObjectInterface $money)
    {
        if (false === Util::classEquals($this, $money)) {
            return false;
        }

        return $this->getAmount()->sameValueAs($money->getAmount()) && $this->getCurrency()->sameValueAs($money->getCurrency());
    }
1102585
public function ap(ApplyInterface $other)
    {
        $this->assertSameType($other);

        $result = [];

        Std::poll(
            function ($ii) use (&$result, &$other) {
                Std::poll(
                    function ($jj) use (&$result, &$other, $ii) {
                        $result[] = Std::call(
                            $this->value[$ii],
                            $other->value[$jj]
                        );
                    },
                    count($other->value)
                );
            },
            count($this->value)
        );

        return $result;
    }
110509
public static function hasValue( $di )
	{
		$components = array( "s", "i", "h", "d", "m", "y" );
		$hasValue = false;
		foreach( $components as $component )
		{
			$hasValue = isset( $di->$component ) && $di->$component != 0;
			if ( $hasValue ) break;
		}
		return $hasValue;
	}
1137846
public function sameValueAs(ValueObjectInterface $dateTimeWithTimeZone)
    {
        if (false === Util::classEquals($this, $dateTimeWithTimeZone)) {
            return false;
        }

        return $this->getDateTime()->sameValueAs($dateTimeWithTimeZone->getDateTime()) &&
            $this->getTimeZone()->sameValueAs($dateTimeWithTimeZone->getTimeZone());
    }
1265245
public function acceptsValue($value): bool {
		switch ($this->operator) {
			case CriteriaComparator::OPERATOR_NOT_IN:
				if ($value === null) return true;
				return !$this->in($value);
			case CriteriaComparator::OPERATOR_IN:
				if ($value === null) return false;
				return !$this->in($value);
				
			case CriteriaComparator::OPERATOR_CONTAINS_NOT:
				ArgUtils::assertTrue(is_array($value));
				
				foreach ($value as $relationEntry) {
					if ($this->in($relationEntry)) return false;
				}
				
				return true;
			case CriteriaComparator::OPERATOR_CONTAINS:
				ArgUtils::assertTrue(is_array($value));
				
				foreach ($value as $relationEntry) {
					if (!$this->in($relationEntry)) return false;
				}
				
				return true;
		}
	}