File

src/app/shared/model/platform.ts

Description

Represents a Platform.

Example

Index

Properties
Methods

Constructor

constructor(name: String, type: String, description: String, options: Array)
Parameters :
Name Type Optional Description
name String
type String
description String
options Array<any>

Methods

Static fromJSON
fromJSON(inputJson: )

Create a Platform from a json

Parameters :
Name Type Optional Description
inputJson
Returns : Platform
Static listFromJSON
listFromJSON(input: )

Create an Array from a json

Parameters :
Name Type Optional Description
input
Returns : Array<Platform>

Properties

Public description
description: String
Type : String
Public name
name: String
Type : String
Public options
options: Array<any>
Type : Array<any>
Public type
type: String
Type : String
export class Platform {

  public name: String;

  public type: String;

  public description: String;

  public options: Array<any>;

  constructor(name: String = '', type: String = '', description: String = '', options: Array<any> = []) {
    this.name = name;
    this.type = type;
    this.description = description;
    this.options = options;
  }

  /**
   * Create a Platform from a json
   * @param inputJson
   * @returns {Platform}
   */
  static fromJSON(inputJson): Platform {
    return new Platform(inputJson.name, inputJson.type, inputJson.description, inputJson.options);
  }

  /**
   * Create an Array<Platform> from a json
   * @param input
   * @returns {Array<Platform>}
   */
  static listFromJSON(input): Array<Platform> {
    if (input && Array.isArray(input)) {
      return input.map(Platform.fromJSON);
    }
    return [];
  }

}

/**
 * Represents a Platform for Tasks.
 *
 * @author Damien Vitrac
 */
export class PlatformTask extends Platform {

  constructor(name: String = '', type: String = '', description: String = '') {
    super(name, type, description);
  }

  /**
   * Create an Array<Platform> from a json
   * @param input
   * @returns {Array<Platform>}
   */
  static listFromJSON(input): Array<Platform> {
    if (input && input._embedded && input._embedded.launcherResourceList) {
      return input._embedded.launcherResourceList.map(Platform.fromJSON);
    }
    return [];
  }

}

results matching ""

    No results matching ""