Exemple #1
0
 public function testCreatePair()
 {
     $number = 42;
     $string = 'string';
     $pair = new Pair($number, $string);
     $this->assertSame($number, $pair->getKey());
     $this->assertSame($string, $pair->getValue());
 }
 public function __construct($vals = null)
 {
     if (!isset(self::$_TSPEC)) {
         self::$_TSPEC = array(1 => array('var' => 'key', 'type' => TType::STRING), 2 => array('var' => 'value', 'type' => TType::STRING));
     }
     if (is_array($vals)) {
         if (isset($vals['key'])) {
             $this->key = $vals['key'];
         }
         if (isset($vals['value'])) {
             $this->value = $vals['value'];
         }
     }
 }
Exemple #3
0
        return $me;
    }
    public function first()
    {
        return $this->v1;
    }
    public function second()
    {
        return $this->v2;
    }
    public function equals($o)
    {
        return $o instanceof self && $this->equal($o::first(), $this->first()) && $this->equal($o::second(), $this->second());
    }
    public function hashCode()
    {
        return $this->first()->hashCode() ^ $this->second()->hashCode();
    }
    protected function equal($first, $second)
    {
        if ($first == null && $second == null) {
            return true;
        }
        if ($first == null || $second == null) {
            return false;
        }
        return $first->equals($second);
    }
}
Pair::__staticinit();
// initialize static vars for this class on load
 public function read($input)
 {
     $xfer = 0;
     $fname = null;
     $ftype = 0;
     $fid = 0;
     $xfer += $input->readStructBegin($fname);
     while (true) {
         $xfer += $input->readFieldBegin($fname, $ftype, $fid);
         if ($ftype == TType::STOP) {
             break;
         }
         switch ($fid) {
             case 0:
                 if ($ftype == TType::LST) {
                     $this->success = array();
                     $_size72 = 0;
                     $_etype75 = 0;
                     $xfer += $input->readListBegin($_etype75, $_size72);
                     for ($_i76 = 0; $_i76 < $_size72; ++$_i76) {
                         $elem77 = null;
                         $elem77 = new Pair();
                         $xfer += $elem77->read($input);
                         $this->success[] = $elem77;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             default:
                 $xfer += $input->skip($ftype);
                 break;
         }
         $xfer += $input->readFieldEnd();
     }
     $xfer += $input->readStructEnd();
     return $xfer;
 }
Exemple #5
0
		function TaskInfo($value1, $value2, $projectId, $projectTitle, $taskName) {
			 parent::Pair($value1, $value2);
			 $this->projectId = $projectId;
			 $this->projectTitle = $projectTitle;
			 $this->taskName = $taskName;
		}