/
Connection.php
72 lines (56 loc) 路 1.21 KB
/
Connection.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
declare(strict_types=1);
namespace Yproximite\Bundle\InfluxDbPresetBundle\Connection;
/**
* Class Connection
*/
class Connection implements ConnectionInterface
{
/**
* @var string
*/
private $name;
/**
* @var string
*/
private $protocol;
/**
* @var bool
*/
private $deferred;
public function getName(): string
{
return $this->name;
}
public function setName(string $name): ConnectionInterface
{
$this->name = $name;
return $this;
}
public function getProtocol(): string
{
return $this->protocol;
}
public function setProtocol(string $protocol): ConnectionInterface
{
$this->protocol = $protocol;
return $this;
}
public function isUdpProtocol(): bool
{
return self::PROTOCOL_UDP === $this->getProtocol();
}
public function isHttpProtocol(): bool
{
return self::PROTOCOL_HTTP === $this->getProtocol();
}
public function isDeferred(): bool
{
return $this->deferred;
}
public function setDeferred(bool $deferred): ConnectionInterface
{
$this->deferred = $deferred;
return $this;
}
}