Skip to main content

Class: ValueObjectModel<T>

Models a value object.

Extends

Type Parameters

Type ParameterDefault type
T extends objectany

Constructors

new ValueObjectModel()

new ValueObjectModel<T>(state: Readonly<StructuralModelState>): ValueObjectModel<T>

Parameters

ParameterType
stateReadonly<StructuralModelState>

Returns

ValueObjectModel<T>

Overrides

StructuralModel.constructor

Defined in

packages/verse-core/src/model/model.ts:1033

Accessors

allProperties

get allProperties(): List<PropertyModel>

Returns

List<PropertyModel>

Inherited from

StructuralModel.allProperties

Defined in

packages/verse-core/src/model/model.ts:401


klass

get klass(): Newable<unknown>

Returns

Newable<unknown>

Inherited from

StructuralModel.klass

Defined in

packages/verse-core/src/model/model.ts:393


name

get name(): string

Returns

string

Inherited from

StructuralModel.name

Defined in

packages/verse-core/src/model/model.ts:380


parent

get parent(): Model

Returns the parent model element.

Returns

Model

The parent model element.

Inherited from

StructuralModel.parent

Defined in

packages/verse-core/src/model/model.ts:477


properties

get properties(): List<PropertyModel>

Returns

List<PropertyModel>

Inherited from

StructuralModel.properties

Defined in

packages/verse-core/src/model/model.ts:397


scalars

get scalars(): List<ScalarPropertyModel>

Returns

List<ScalarPropertyModel>

Inherited from

StructuralModel.scalars

Defined in

packages/verse-core/src/model/model.ts:425


scalarsAndValues

get scalarsAndValues(): List<ScalarPropertyModel | ValueObjectPropertyModel>

Returns

List<ScalarPropertyModel | ValueObjectPropertyModel>

Inherited from

StructuralModel.scalarsAndValues

Defined in

packages/verse-core/src/model/model.ts:437


state

get protected state(): StructuralModelState

Returns

StructuralModelState

Overrides

StructuralModel.state

Defined in

packages/verse-core/src/model/model.ts:1045


values

get values(): List<ValueObjectPropertyModel>

Returns

List<ValueObjectPropertyModel>

Inherited from

StructuralModel.values

Defined in

packages/verse-core/src/model/model.ts:431

Methods

accept()

accept<T, S>(visitor: ModelVisitor<T, S>, state?: S): T

Accepts a visitor and returns the result of visiting this model element.

Type Parameters

Type ParameterDefault type
T-
Sunknown

Parameters

ParameterTypeDescription
visitorModelVisitor<T, S>The visitor to accept.
state?SAn optional state to pass to the visitor.

Returns

T

The result of visiting this model element.

Overrides

StructuralModel.accept

Defined in

packages/verse-core/src/model/model.ts:1059


equals()

equals(other: unknown): boolean

Checks if the current object is equal to the provided object.

Parameters

ParameterTypeDescription
otherunknownThe object to compare with.

Returns

boolean

Whether the objects are equal or not.

Overrides

StructuralModel.equals

Defined in

packages/verse-core/src/model/model.ts:1071


hashCode()

hashCode(): number

Returns the hash code of this object.

Returns

number

The hash code.

Inherited from

StructuralModel.hashCode

Defined in

packages/verse-core/src/model/model.ts:497


merge()

merge(config: ValueObjectModel<any>): ValueObjectModel<any>

Parameters

ParameterType
configValueObjectModel<any>

Returns

ValueObjectModel<any>

Defined in

packages/verse-core/src/model/model.ts:1049


rewrite()

rewrite(rewriter: ModelRewriter): ValueObjectModel<T>

Rewrite method for processing a given model with a rewriter.

Parameters

ParameterTypeDescription
rewriterModelRewriterThe rewriter to use for rewriting the model.

Returns

ValueObjectModel<T>

The rewritten model.

Overrides

StructuralModel.rewrite

Defined in

packages/verse-core/src/model/model.ts:1063


scalar()

scalar(name: string): ScalarPropertyModel

Parameters

ParameterType
namestring

Returns

ScalarPropertyModel

Inherited from

StructuralModel.scalar

Defined in

packages/verse-core/src/model/model.ts:441


scalarFlatMap()

scalarFlatMap<T>(action: (path: ScalarPropertyPath) => T): List<T>

Type Parameters

Type ParameterDefault type
TScalarPropertyPath

Parameters

ParameterType
action(path: ScalarPropertyPath) => T

Returns

List<T>

Inherited from

StructuralModel.scalarFlatMap

Defined in

packages/verse-core/src/model/model.ts:451


toJSON()

toJSON(): string

Returns a JSON representation of this model element.

Returns

string

The JSON representation.

Inherited from

StructuralModel.toJSON

Defined in

packages/verse-core/src/model/model.ts:82


toObject()

toObject(): {name: string;properties: object[]; }

Returns this instance as a plain object.

Returns

{name: string;properties: object[]; }

The plain object.

name

name: string

properties

properties: object[]

Inherited from

StructuralModel.toObject

Defined in

packages/verse-core/src/model/model.ts:481


withName()

withName(name: string): any

Parameters

ParameterType
namestring

Returns

any

Inherited from

StructuralModel.withName

Defined in

packages/verse-core/src/model/model.ts:384


withProperties()

protected withProperties(properties: List<PropertyModel>): ValueObjectModel<T>

Parameters

ParameterType
propertiesList<PropertyModel>

Returns

ValueObjectModel<T>

Overrides

StructuralModel.withProperties

Defined in

packages/verse-core/src/model/model.ts:1041


withProperty()

withProperty(property: PropertyModel): StructuralModel

Parameters

ParameterType
propertyPropertyModel

Returns

StructuralModel

Inherited from

StructuralModel.withProperty

Defined in

packages/verse-core/src/model/model.ts:405