From 7fdf733a64670fceefc3ded35cfa581e1c458179 Mon Sep 17 00:00:00 2001 From: Einav Weiss Keidar Date: Tue, 20 Mar 2018 14:45:40 +0200 Subject: Adding Prettier and fixing up eslint version Issue-ID: SDC-1094 Change-Id: Ie83ad95a03899345dd90235daf0323cbe3bc6afd Signed-off-by: Einav Weiss Keidar --- .../lib/ecomp/asdc/sequencer/model/Metamodel.js | 116 ++++++++++----------- 1 file changed, 57 insertions(+), 59 deletions(-) (limited to 'dox-sequence-diagram-ui/src/main/webapp/lib/ecomp/asdc/sequencer/model/Metamodel.js') diff --git a/dox-sequence-diagram-ui/src/main/webapp/lib/ecomp/asdc/sequencer/model/Metamodel.js b/dox-sequence-diagram-ui/src/main/webapp/lib/ecomp/asdc/sequencer/model/Metamodel.js index 82e8ada588..140b7ef547 100644 --- a/dox-sequence-diagram-ui/src/main/webapp/lib/ecomp/asdc/sequencer/model/Metamodel.js +++ b/dox-sequence-diagram-ui/src/main/webapp/lib/ecomp/asdc/sequencer/model/Metamodel.js @@ -22,73 +22,71 @@ import Common from '../common/Common'; * Rules governing what a definition can contain. */ export default class Metamodel { + // /////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Construct from JSON definition. + * @param json schema definition. + */ + constructor(json) { + Common.assertType(json, 'Object'); + const dfault = require('./templates/default.metamodel.json'); + this.json = _merge({}, dfault, json); + } - // /////////////////////////////////////////////////////////////////////////////////////////////// - - /** - * Construct from JSON definition. - * @param json schema definition. - */ - constructor(json) { - Common.assertType(json, 'Object'); - const dfault = require('./templates/default.metamodel.json'); - this.json = _merge({}, dfault, json); - } - - // /////////////////////////////////////////////////////////////////////////////////////////////// - - /** - * Get schema identifier. - * @returns ID. - */ - getId() { - return this.json.diagram.metadata.id; - } - - // /////////////////////////////////////////////////////////////////////////////////////////////// + // /////////////////////////////////////////////////////////////////////////////////////////////// - /** - * Get lifeline constraints. - * @returns {*} - */ - getConstraints() { - return this.json.diagram.lifelines.constraints; - } + /** + * Get schema identifier. + * @returns ID. + */ + getId() { + return this.json.diagram.metadata.id; + } - // /////////////////////////////////////////////////////////////////////////////////////////////// + // /////////////////////////////////////////////////////////////////////////////////////////////// - /** - * Get lifeline metadata by lifeline ID. - * @param id sought lifeline. - * @returns lifeline if found. - */ - getLifelineById(id) { - for (const lifeline of this.json.diagram.lifelines.lifelines) { - if (lifeline.id === id) { - return lifeline; - } + /** + * Get lifeline constraints. + * @returns {*} + */ + getConstraints() { + return this.json.diagram.lifelines.constraints; } - return undefined; - } - // /////////////////////////////////////////////////////////////////////////////////////////////// + // /////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Get lifeline metadata by lifeline ID. + * @param id sought lifeline. + * @returns lifeline if found. + */ + getLifelineById(id) { + for (const lifeline of this.json.diagram.lifelines.lifelines) { + if (lifeline.id === id) { + return lifeline; + } + } + return undefined; + } - /** - * Get original JSON. - * @returns JSON. - */ - unwrap() { - return this.json; - } + // /////////////////////////////////////////////////////////////////////////////////////////////// - // /////////////////////////////////////////////////////////////////////////////////////////////// + /** + * Get original JSON. + * @returns JSON. + */ + unwrap() { + return this.json; + } - /** - * Get default schema. - * @returns Metamodel default (permissive) Metamodel. - */ - static getDefault() { - return new Metamodel({}); - } + // /////////////////////////////////////////////////////////////////////////////////////////////// + /** + * Get default schema. + * @returns Metamodel default (permissive) Metamodel. + */ + static getDefault() { + return new Metamodel({}); + } } -- cgit 1.2.3-korg