File

src/models/property/property.ts

Description

Abstract base class for a serializable REDHAWK Property model

Implements

ISerializable

Index

Properties
Methods

Constructor

constructor(id?: string, name?: string, value?: AnyValueType)

Constructor

Parameters :
Name Type Optional Description
id string true

The property's ID

name string true

The property's Name

value AnyValueType true

The value of the property

Methods

copy
copy()

Create a copy of this Property.

Returns : Property
deserialize
deserialize(input: any)

WARNING: This is a partial deserialization. Used the derived classes instead:

Parameters :
Name Type Optional Description
input any

The JSON object to deserialize into this property's members.

Returns : this

Properties

id
id: string
Type : string

Property's unique ID

kinds
kinds: Array | scaKind.ScaKindPost200
Type : Array | scaKind.ScaKindPost200
Default value : 'property'

The 'kinds' of the property

mode
mode: Mode
Type : Mode
Default value : 'readwrite'

Access mode

name
name: string
Type : string

Typically, a more human-readable Name

scaType
scaType: ScaType
Type : ScaType

SCA Type of the property

value
value: AnyValueType
Type : AnyValueType

value of the property

import { ISerializable } from '../serialization/index';

import { AnyValueType } from './any-value-type';
import { Mode } from './mode';
import { ScaType } from './sca-types';
import * as scaKind from './sca-kinds';

/**
 * Abstract base class for a serializable REDHAWK Property model
 */
export abstract class Property implements ISerializable<Property> {
    /** Property's unique ID */
    id: string;
    /** Typically, a more human-readable Name */
    name: string;
    /** value of the property */
    value: AnyValueType;
    /** SCA Type of the property */
    scaType: ScaType;
    /** The 'kinds' of the property */
    kinds: Array<scaKind.ScaKindPre200> | scaKind.ScaKindPost200 = 'property';
    /** Access mode */
    mode: Mode = 'readwrite';

    /**
     * Constructor 
     * @param [id] The property's ID
     * @param [name] The property's Name
     * @param [value] The value of the property
    */
    constructor(id?: string, name?: string, value?: AnyValueType) {
        this.id = id;
        this.name = name;
        this.value = value;
        this.kinds = [];
    }

    /**
     * **WARNING:** This is a partial deserialization.
     * Used the derived classes instead:
     *  * {@link SimpleProperty}
     *  * {@link SimpleSeqProperty}
     *  * {@link StructProperty}
     *  * {@link StructSeqProperty}
     * @param input The JSON object to deserialize into this property's members.
     */
    deserialize(input: any) {
        this.id = input.id;
        this.name = input.name;
        this.mode = input.mode;
        this.kinds = input.kinds;
        return this;
    }

    /**
     * Create a copy of this Property.
     */
    abstract copy(): Property;
}

results matching ""

    No results matching ""