File

src/app/models/color.ts

Description

Color model

Implements

Deserializable

Example

Index

Properties
Methods

Constructor

constructor(id: number, name: string, conditions: Array, imageSrc: string, animation: string)
Parameters :
Name Type Optional
id number no
name string no
conditions Array<string> no
imageSrc string no
animation string no

Properties

animation
animation: string
Type : string
conditions
conditions: Array<string>
Type : Array<string>
id
id: number
Type : number
imageSrc
imageSrc: string
Type : string
name
name: string
Type : string

Methods

Public deserialize
deserialize(input: any)

Deserialize Color model

Parameters :
Name Type Optional
input any no
Returns : Color
import {Deserializable} from '../deserializable';

/**
 * Color model
 * @class Color
 * @implements Deserializable<Color>
 */
export class Color implements Deserializable<Color> {
  id: number;
  name: string;
  conditions: Array<string>;
  imageSrc: string;
  animation: string;

   /**
   * @constructor
   * @param {id} id
   * @param {name} name
   * @param {conditions} conditions
   * @param {imageSrc} imageSrc
   * @param {animation} animation
   */
  constructor(id: number, name: string, conditions: Array<string>, imageSrc: string, animation: string) {
    this.id = id;
    this.name = name;
    this.conditions = conditions;
    this.imageSrc = imageSrc;
    this.animation = animation;
  }

  /**
   * Deserialize Color model
   * @param {input} any
   * @returns {this}
   */
  public deserialize(input: any): Color {
    Object.assign(this, input);
    return this;
  }
}

results matching ""

    No results matching ""