/*********************************************************************************************************************************
This class has been automatically generated using KLTT-APIRestGenerator project, don't do manual file modifications.
Fri Jul 13 17:25:45 CEST 2018
"Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements;
and to You under the Apache License, Version 2.0. "
**********************************************************************************************************************************/
import {RandomValues} from '../utils/random-values.utils' ;
import {ParserValues} from '../utils/parser-values.utils' ;
/**
* No description for the module
*/
export class Person
{
/**
* Public constructor
*/
constructor(public personName: string, public firstName: string, public lastName: string, public age: number)
{
this.personName = personName ;
this.firstName = firstName ;
this.lastName = lastName ;
this.age = age ;
}
/**
* @param personName the personName to set
*/
setPersonName(personName)
{
this.personName = personName ;
}
/**
* @return the personName
*/
getPersonName()
{
return this.personName ;
}
/**
* @param firstName the firstName to set
*/
setFirstName(firstName)
{
this.firstName = firstName ;
}
/**
* @return the firstName
*/
getFirstName()
{
return this.firstName ;
}
/**
* @param lastName the lastName to set
*/
setLastName(lastName)
{
this.lastName = lastName ;
}
/**
* @return the lastName
*/
getLastName()
{
return this.lastName ;
}
/**
* @param age the age to set
*/
setAge(age)
{
this.age = age ;
}
/**
* @return the age
*/
getAge()
{
return this.age ;
}
/**
* @return the object as string
*/
toString()
{
return JSON.stringify(this, null, 4) ;
}
/**
* @param pendingRecursiveCalls with the pending recursive calls
* @return a new instance of the class with a random values
*/
static generateRandomInstance(pendingRecursiveCalls: number)
{
Iif (pendingRecursiveCalls == 0)
{
return null ;
}
pendingRecursiveCalls -- ;
var personName = RandomValues.generateRandomString() ;
var firstName = RandomValues.generateRandomString() ;
var lastName = RandomValues.generateRandomString() ;
var age = RandomValues.generateRandomNumber() ;
return new Person(personName, firstName, lastName, age) ;
}
/**
* @param internalValueParseGenerator with the json to be parsed
* @return an instance of this class
*/
static parse(internalValueParseGenerator)
{
var personName ;
if (internalValueParseGenerator.personName != null && internalValueParseGenerator.personName != "undefined")
{
personName = ParserValues.stringParser(internalValueParseGenerator.personName) ;
}
var firstName ;
if (internalValueParseGenerator.firstName != null && internalValueParseGenerator.firstName != "undefined")
{
firstName = ParserValues.stringParser(internalValueParseGenerator.firstName) ;
}
var lastName ;
if (internalValueParseGenerator.lastName != null && internalValueParseGenerator.lastName != "undefined")
{
lastName = ParserValues.stringParser(internalValueParseGenerator.lastName) ;
}
var age ;
if (internalValueParseGenerator.age != null && internalValueParseGenerator.age != "undefined")
{
age = ParserValues.numberParser(internalValueParseGenerator.age) ;
}
return new Person(personName, firstName, lastName, age) ;
}
};
|