3 final class AlmanacAddress
extends Phobject
{
9 private function __construct() {
13 public function getNetworkPHID() {
14 return $this->networkPHID
;
17 public function getAddress() {
18 return $this->address
;
21 public function getPort() {
25 public static function newFromDictionary(array $dictionary) {
26 return self
::newFromParts(
27 $dictionary['networkPHID'],
28 $dictionary['address'],
32 public static function newFromParts($network_phid, $address, $port) {
33 $addr = new AlmanacAddress();
35 $addr->networkPHID
= $network_phid;
36 $addr->address
= $address;
37 $addr->port
= (int)$port;
42 public function toDictionary() {
44 'networkPHID' => $this->getNetworkPHID(),
45 'address' => $this->getAddress(),
46 'port' => $this->getPort(),
50 public function toHash() {
51 return PhabricatorHash
::digestForIndex(json_encode($this->toDictionary()));