all files / src/model/ person.model.ts

62% Statements 31/50
5.56% Branches 1/18
23.08% Functions 3/13
58.7% Lines 27/46
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156                1× 1×         1×         10×   10× 10× 10× 10×           1×               1×               1×               1×               1×               1×               1×               1×                 1×                 1×   5×         5×   5× 5× 5× 5×   5×             1×                                                         1×  
/*********************************************************************************************************************************
 This class has been automatically generated using KLTT-APIRestGenerator project, don't do manual file modifications.
 Thu Jul 19 12:37:49 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) ;	
	}
};