src/app/streams/model/stream-definition.ts
Represents a StreamDefiniton.
Properties |
|
Methods |
|
constructor(name: string, dslText: string, status: string)
|
Public fromJSON | ||||||||
fromJSON(input: )
|
||||||||
Create a StreamDefinition from JSON
Parameters :
Returns :
StreamDefinition
|
Public pageFromJSON | ||||||||
pageFromJSON(input: )
|
||||||||
Create a Page
Parameters :
Returns :
Page<StreamDefinition>
|
Public deploymentProperties |
deploymentProperties:
|
Type : any
|
Public dslText |
dslText:
|
Type : string
|
Public force |
force:
|
Default value : false
|
Public name |
name:
|
Type : string
|
Public status |
status:
|
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;
}
}