Skip to content

Latest commit

 

History

History
166 lines (98 loc) · 6.53 KB

File metadata and controls

166 lines (98 loc) · 6.53 KB

@onzag/itemize / Modules / base/Root/Module/ItemDefinition/PropertiesValueMappingDefiniton / default

Class: default

base/Root/Module/ItemDefinition/PropertiesValueMappingDefiniton.default

This class provides the utility for the properties that are set to a specific item, for example let's say there's an item named Vehicle, which can have a property for it being type "car", "motorbike, or "moped"; such vehicle has a wheelset, and this wheelset has properties of its own

{ "definition": "wheelset", "enforcedProperties" : { "amount": { "exactValue": 4 }, "type": { "exactValue": "car" }, }, },

represents a list of properties for an specific item named wheelset, this is a PropertiesValueMappingDefiniton

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new default(rawJSON, parentItemDefinition, referredItemDefinition): default

Contructor for the class

Parameters

Name Type Description
rawJSON IPropertiesValueMappingDefinitonRawJSONDataType the raw data as JSON
parentItemDefinition default the item definition that this node is located, its root; for the example above that would be the vehicle item definition
referredItemDefinition default the item definition that these properties are attempted to be set against, for the example above that would be the wheelset item definition

Returns

default

Defined in

base/Root/Module/ItemDefinition/PropertiesValueMappingDefiniton/index.ts:65

Properties

parentItemDefinition

parentItemDefinition: default

Defined in

base/Root/Module/ItemDefinition/PropertiesValueMappingDefiniton/index.ts:53


rawData

rawData: IPropertiesValueMappingDefinitonRawJSONDataType

Defined in

base/Root/Module/ItemDefinition/PropertiesValueMappingDefiniton/index.ts:51


referredItemDefinition

referredItemDefinition: default

Defined in

base/Root/Module/ItemDefinition/PropertiesValueMappingDefiniton/index.ts:52

Methods

getPropertyMap

getPropertyMap(): { id: string ; value: PropertyDefinitionSupportedType | default }[]

Gives a property map in the form id and value for properties

Returns

{ id: string ; value: PropertyDefinitionSupportedType | default }[]

the property map with property values

Defined in

base/Root/Module/ItemDefinition/PropertiesValueMappingDefiniton/index.ts:79


getPropertyValue

getPropertyValue(key): PropertyDefinitionSupportedType | default

Retrieves a property value for a given property id

Parameters

Name Type Description
key string the property id

Returns

PropertyDefinitionSupportedType | default

either a peroperty supported value or a property definition itself for referred properties

Defined in

base/Root/Module/ItemDefinition/PropertiesValueMappingDefiniton/index.ts:108


hasPropertyValue

hasPropertyValue(key): boolean

Checks whether it contains a property value for a specific property id

Parameters

Name Type Description
key string the property id

Returns

boolean

a boolean on whether it has such a property value

Defined in

base/Root/Module/ItemDefinition/PropertiesValueMappingDefiniton/index.ts:97