Annotated

Annotated

The Annotated class provides a store for arbitrary object-wide metadata. It is intended as a base class for other structures and should not be constructed directly.

Constructor

new Annotated(metadata)

Source:
Parameters:
Name Type Description
metadata Object | Map

Object or Map containing arbitrary metadata as key-value pairs.

Classes

Annotated

Methods

$setMetadata(value) → {Annotated}

Source:
Parameters:
Name Type Description
value Object

Object containing the metadata.

Returns:

A reference to this Annotated object.

Type
Annotated

metadata() → {Map}

Source:
Returns:

Map containing arbitrary metadata.

Type
Map

setMetadata(value, optionsopt) → {Annotated}

Source:
Parameters:
Name Type Attributes Default Description
value Object | Map

Object containing the metadata.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this Annotated instance in place. If false, a new instance is returned.

Returns:

The Annotated object after replacing the metadata. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

Type
Annotated