diff --git a/Common/Types/Name.ts b/Common/Types/Name.ts index e69de29bb2..bb69cbba61 100644 --- a/Common/Types/Name.ts +++ b/Common/Types/Name.ts @@ -0,0 +1,38 @@ +export default class Name { + + private _title : string = ''; + public get title() : string { + return this._title; + } + public set title(v : string) { + this._title = v; + } + + private _name: string = ''; + public get name(): string { + return this._name; + } + public set name(v: string) { + this._name = v; + } + + constructor(name: string) { + this.name = name; + } + + getFirstName() { + return this.name.split(' ')[0]; + } + + getLastName() { + return this.name.split(' ')[this.name.split(' ').length -1]; + } + + getMiddleName() { + return this.name.split(' ')[0]; + } + + toString(): string { + return this.name; + } +} diff --git a/Common/Types/Port.ts b/Common/Types/Port.ts index 1f352cf9d4..731cf06414 100644 --- a/Common/Types/Port.ts +++ b/Common/Types/Port.ts @@ -6,12 +6,12 @@ export default class Port { public get port(): PositiveNumber { return this._port; } - public set port (v: PositiveNumber) { + public set port(v: PositiveNumber) { this._port = v; } - constructor (port: number) { - if (port >= 0 && port <= 65535) { + constructor(port: number) { + if (port >= 0 && port <= 65535) { this.port = new PositiveNumber(port); } else { throw new BadDataException(