File

src/app/streams/model/stream-definition.ts

Description

Represents a StreamDefiniton.

Example

Index

Properties
Methods

Constructor

constructor(name: string, dslText: string, status: string)
Parameters :
Name Type Optional Description
name string
dslText string
status string

Methods

Public fromJSON
fromJSON(input: )

Create a StreamDefinition from JSON

Parameters :
Name Type Optional Description
input
Returns : StreamDefinition
Public pageFromJSON
pageFromJSON(input: )

Create a Page from JSON

Parameters :
Name Type Optional Description
input

Properties

Public deploymentProperties
deploymentProperties: any
Type : any
Public dslText
dslText: string
Type : string
Public force
force:
Default value : false
Public name
name: string
Type : string
Public status
status: string
Type : string
import { Page } from '../../shared/model/page';

/**
 * Represents a StreamDefiniton.
 *
 * @author Janne Valkealahti
 * @author Gunnar Hillert
 * @author Damien Vitrac
 */
export class StreamDefinition {

  public name: string;

  public dslText: string;

  public status: string;

  public deploymentProperties: any;

  public force = false;

  constructor(name: string, dslText: string, status: string) {
    this.name = name;
    this.dslText = dslText;
    this.status = status;
  }

  /**
   * Create a StreamDefinition from JSON
   * @param input
   * @returns {StreamDefinition}
   */
  public static fromJSON(input): StreamDefinition {
    const stream = new StreamDefinition(input.name, input.dslText, input.status);
    if (input.deploymentProperties && input.deploymentProperties.length > 0) {
      stream.deploymentProperties = JSON.parse(input.deploymentProperties);
    }
    return stream;
  }

  /**
   * Create a Page<StreamDefinition> from JSON
   * @param input
   * @returns {Page<StreamDefinition>}
   */
  public static pageFromJSON(input): Page<StreamDefinition> {
    const page = Page.fromJSON<StreamDefinition>(input);
    if (input && input._embedded && input._embedded.streamDefinitionResourceList) {
      page.items = input._embedded.streamDefinitionResourceList.map(StreamDefinition.fromJSON);
    }
    return page;
  }

}

results matching ""

    No results matching ""