key = $key; $this->type = $type; $this->name = $name; $this->factory = $factory; $this->args = $args; } public function getKey(): string { return $this->key; } public function getType(): string { return $this->type; } public function getName(): string { return $this->name; } public function getFactory(): callable { return $this->factory; } /** @return mixed */ public function getValue(Payload $payload) { return $this->getFactory()($payload); } public function getArgs(): array { return $this->args; } }