1
|
|
|
<?php |
2
|
|
|
declare(strict_types=1); |
3
|
|
|
|
4
|
|
|
/** |
5
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
6
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
7
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
8
|
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
9
|
|
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
10
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
11
|
|
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
12
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
13
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
14
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
15
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
16
|
|
|
*/ |
17
|
|
|
|
18
|
|
|
namespace Ytake\PrestoClient; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* Class Column |
22
|
|
|
* |
23
|
|
|
* @author Yuuki Takezawa <[email protected]> |
24
|
|
|
*/ |
25
|
|
|
final class Column |
26
|
|
|
{ |
27
|
|
|
/** @var string */ |
28
|
|
|
private $name = ''; |
29
|
|
|
|
30
|
|
|
/** @var string */ |
31
|
|
|
private $type = ''; |
32
|
|
|
|
33
|
|
|
/** @var \stdClass */ |
34
|
|
|
private $typeSignature; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* Column constructor. |
38
|
|
|
* |
39
|
|
|
* @param \stdClass $jsonContent |
40
|
|
|
*/ |
41
|
|
|
public function __construct(\stdClass $jsonContent) |
42
|
|
|
{ |
43
|
|
|
$this->name = $jsonContent->name; |
44
|
|
|
$this->type = $jsonContent->type; |
45
|
|
|
$this->typeSignature = $jsonContent->typeSignature; |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @return string |
50
|
|
|
*/ |
51
|
|
|
public function getName(): string |
52
|
|
|
{ |
53
|
|
|
return $this->name; |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* @return string |
58
|
|
|
*/ |
59
|
|
|
public function getType(): string |
60
|
|
|
{ |
61
|
|
|
return $this->type; |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* @return mixed |
66
|
|
|
*/ |
67
|
|
|
public function getTypeSignature() |
68
|
|
|
{ |
69
|
|
|
return $this->typeSignature; |
70
|
|
|
} |
71
|
|
|
} |
72
|
|
|
|