public function sameValueAs(ValueObjectInterface $other)
 {
     if (!$other instanceof RouteSpecification) {
         return false;
     }
     return EqualsBuilder::create()->append($this->origin(), $other->origin())->append($this->destination(), $other->destination())->equals();
 }
 /**
  * @param ValueObjectInterface $other
  * @return boolean
  */
 public function sameValueAs(ValueObjectInterface $other)
 {
     if (!$other instanceof RoleDescription) {
         return false;
     }
     return EqualsBuilder::create()->append($this->name()->sameValueAs($other->name()), true)->append($this->options()->sameValueAs($other->options()), true)->strict()->equals();
 }
 public function testItComparesItemCountOfTheGivenListsBeforeUsingCallback()
 {
     $callbackUsed = false;
     $aList = array(new Address('Hauptstrasse', '1', '10115', 'Berlin'), new Address('Postweg', '2', '12345', 'Testhausen'));
     $bList = array(new Address('Hauptstrasse', '1', '10115', 'Berlin'), new Address('Postweg', '2', '12345', 'Testhausen'), new Address('Postweg', '2', '12345', 'Testhausen'));
     $this->assertFalse(EqualsBuilder::create()->append($aList, $bList, function (Address $a, Address $b) use(&$callbackUsed) {
         $callbackUsed = true;
         return $a->sameValueAs($b);
     })->equals());
     $this->assertFalse($callbackUsed);
 }
 /**
  * @param Type $other
  * @return boolean
  */
 public function sameAs(Type $other)
 {
     $calledClass = get_called_class();
     if (!$other instanceof $calledClass) {
         return false;
     }
     $myProperties = $this->properties();
     $otherProperties = $other->properties();
     if ($this->description()->hasIdentifier()) {
         return $myProperties[$this->description()->identifierName()]->type()->sameAs($otherProperties[$this->description()->identifierName()]->type());
     }
     $equalsBuilder = EqualsBuilder::create();
     foreach ($this->properties() as $propertyName => $property) {
         $equalsBuilder->append($property->type()->sameAs($otherProperties[$propertyName]->type()));
     }
     return $equalsBuilder->equals();
 }
 /**
  * @param ValueObjectInterface $other
  * @return boolean
  */
 public function sameValueAs(ValueObjectInterface $other)
 {
     if (!$other instanceof MetaInformation) {
         return false;
     }
     return EqualsBuilder::create()->append($this->workflowRunId()->toString(), $other->workflowRunId()->toString())->append($this->actionId()->toString(), $other->actionId()->toString())->append($this->actionName()->toString(), $other->actionName()->toString())->append($this->actionArguments()->toArray(), $other->actionArguments()->toArray())->append($this->resultSetCount(), $other->resultSetCount())->equals();
 }
示例#6
0
 /**
  * @param Task $task
  * @return bool
  */
 public function equals(Task $task)
 {
     if (!$task instanceof ProcessData) {
         return false;
     }
     return EqualsBuilder::create()->append($this->target, $task->target)->append($this->allowedTypes, $task->allowedTypes)->append($this->preferredType, $task->preferredType)->append($this->metadata(), $task->metadata())->strict()->equals();
 }
示例#7
0
 /**
  * @param ValueObjectInterface $other
  * @return bool
  */
 public function sameValueAs(ValueObjectInterface $other)
 {
     if (!$other instanceof Leg) {
         return false;
     }
     return EqualsBuilder::create()->append($this->loadLocation(), $other->loadLocation())->append($this->unloadLocation(), $other->unloadLocation())->append($this->loadTime()->getTimestamp(), $other->loadTime()->getTimestamp())->append($this->unloadTime()->getTimestamp(), $other->unloadTime()->getTimestamp())->equals();
 }
示例#8
0
 /**
  * @param ValueObjectInterface $other
  * @return boolean
  */
 public function sameValueAs(ValueObjectInterface $other)
 {
     if (!$other instanceof ProcessStep) {
         return false;
     }
     if ($this->isAgentDescription()) {
         if (!$other->isAgentDescription()) {
             return false;
         }
         return $this->agentDescription()->sameValueAs($other->agentDescription());
     } else {
         if ($other->isAgentDescription()) {
             return false;
         }
         return EqualsBuilder::create()->append($this->roleDescription()->sameValueAs($other->roleDescription()), true)->append($this->actionDescription()->sameValueAs($other->actionDescription()), true)->equals();
     }
 }
示例#9
0
 /**
  * @param ValueObjectInterface $other
  * @return boolean
  */
 public function sameValueAs(ValueObjectInterface $other)
 {
     if (!$other instanceof StructureItem) {
         return false;
     }
     return EqualsBuilder::create()->append($this->key(), $other->key())->append($this->pathKeys(), $other->pathKeys())->append($this->valueType(), $other->valueType())->strict()->equals();
 }
 /**
  * @param ValueObjectInterface $other
  * @return boolean
  */
 public function sameValueAs(ValueObjectInterface $other)
 {
     if (!$other instanceof ActionDescription) {
         return false;
     }
     if ($this->hasStructureDefinition()) {
         if (!$other->hasStructureDefinition()) {
             return false;
         }
         if (!$this->structureDefinition()->sameValueAs($other->structureDefinition())) {
             return false;
         }
     }
     if (!$this->hasStructureDefinition() && $other->hasStructureDefinition()) {
         return false;
     }
     if (!is_null($this->eventsDefinition()) && !is_null($other->eventsDefinition())) {
         if (!$this->eventsDefinition()->sameValueAs($other->eventsDefinition())) {
             return false;
         }
     } else {
         if (!is_null($this->eventsDefinition()) && is_null($other->eventsDefinition())) {
             return false;
         } else {
             if (is_null($this->eventsDefinition()) && !is_null($other->eventsDefinition())) {
                 return false;
             }
         }
     }
     return EqualsBuilder::create()->append($this->name()->sameValueAs($other->name()), true)->append($this->type()->sameValueAs($other->type()), true)->append($this->arguments()->sameValueAs($other->arguments()), true)->strict()->equals();
 }