public function appendAttribute($attr, $value, $type, $metadata = null, $options = []) {
        $attrs = [
            $attr => [
                "value" => $value,
                "type" => $type
            ]
        ];

        if ($metadata != null) {
            $attrs['metadata'] = $metadata;
        }
        return $this->appendAttributes($attrs, $options);
    }