All files / src/models/Data PrjData.ts

0% Statements 0/27
0% Branches 0/2
0% Functions 0/10
0% Lines 0/25

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112                                                                                                                                                                                                                               
import { fieldConfig } from 'src/classes/decorators/FieldConfigDecorator';
import { ImplementsStatic } from 'src/classes/decorators/ImplementsStatic';
import { toStringField } from 'src/classes/decorators/ToStringFieldDecorator';
import { Inject } from 'src/libs/DependencyInjection/decorators/Inject';
import type {
    IFileType,
    IFileType_,
} from 'src/libs/FileType/interfaces/IFileType';
import type { ITags, ITags_ } from 'src/libs/Tags/interfaces/ITags';
import { FileSubType } from 'src/types/PrjTypes';
import { IPrjData, IPrjData_ } from './interfaces/IPrjData';
import PrjBaseData from './PrjBaseData';
 
/**
 * Represents a project data.
 */
@ImplementsStatic<IPrjData_<unknown>>()
export class PrjData<T> extends PrjBaseData<T> implements IPrjData {
    @Inject('IFileType_')
    protected _IFileType!: IFileType_;
    @Inject('ITags_')
    protected _ITags!: ITags_;
 
    protected _type: IFileType | null | undefined;
    protected _subType: FileSubType | null | undefined;
    protected _tags: ITags | null | undefined;
    protected _title: string | null | undefined;
    protected _description: string | null | undefined;
 
    /**
     * @inheritdoc
     */
    @fieldConfig()
    get type(): IFileType | null | undefined {
        return this._type as IFileType | null | undefined;
    }
 
    /**
     * @inheritdoc
     */
    set type(value: unknown) {
        this._type = new this._IFileType(value);
    }
 
    /**
     * @inheritdoc
     */
    @fieldConfig()
    get subType(): FileSubType | null | undefined {
        return this._subType;
    }
 
    /**
     * @inheritdoc
     */
    set subType(value: unknown) {
        this._subType = value as FileSubType | null | undefined;
    }
 
    /**
     * @inheritdoc
     */
    @toStringField
    @fieldConfig()
    get tags(): ITags | null | undefined {
        return this._tags;
    }
 
    /**
     * @inheritdoc
     */
    set tags(value: unknown) {
        if (value instanceof this._ITags) {
            this._tags = value;
        } else {
            this._tags = new this._ITags(value);
        }
    }
 
    /**
     * @inheritdoc
     */
    @toStringField
    @fieldConfig()
    get title(): string | null | undefined {
        return this._title;
    }
 
    /**
     * @inheritdoc
     */
    set title(value: string | null | undefined) {
        this._title = value;
    }
 
    /**
     * @inheritdoc
     */
    @toStringField
    @fieldConfig()
    get description(): string | null | undefined {
        return this._description;
    }
 
    /**
     * @inheritdoc
     */
    set description(value: string | null | undefined) {
        this._description = value;
    }
}
 
Zur TypeDoc-Dokumentation