-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathAvroField.php
69 lines (59 loc) · 1.48 KB
/
AvroField.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
<?php
declare(strict_types=1);
namespace PhpKafka\PhpAvroSchemaGenerator\Avro;
final class AvroField implements AvroFieldInterface
{
/** @var mixed */
private $fieldDefault;
private ?string $fieldDoc;
private ?string $fieldLogicalType;
private string $fieldName;
/** @var string|string[] */
private $fieldType;
/**
* @param string $fieldName
* @param string[]|string $fieldType
* @param null|mixed $fieldDefault
* @param null|string $fieldDoc
* @param null|string $fieldLogicalType
*/
public function __construct(
string $fieldName,
$fieldType,
$fieldDefault = self::NO_DEFAULT,
?string $fieldDoc = null,
?string $fieldLogicalType = null
) {
$this->fieldDefault = $fieldDefault;
$this->fieldDoc = $fieldDoc;
$this->fieldLogicalType = $fieldLogicalType;
$this->fieldName = $fieldName;
$this->fieldType = $fieldType;
}
/**
* @return mixed
*/
public function getFieldDefault()
{
return $this->fieldDefault;
}
public function getFieldDoc(): ?string
{
return $this->fieldDoc;
}
public function getFieldLogicalType(): ?string
{
return $this->fieldLogicalType;
}
public function getFieldName(): string
{
return $this->fieldName;
}
/**
* @return string[]|string
*/
public function getFieldType()
{
return $this->fieldType;
}
}