lib-utils-ts
Version:
<img src="https://img.shields.io/npm/v/lib-utils-ts"/> <img src="https://img.shields.io/snyk/vulnerabilities/npm/lib-utils-ts"/> <img src="https://img.shields.io/npm/l/lib-utils-ts"/> <img src="https://img.shields.io/github/languages/top/devGnode/lib-util
31 lines (21 loc) • 901 B
text/typescript
import {PathParams} from "./EndPoint";
export class PathParam {
private readonly pathParameters:PathParams;
private readonly value:Object;
public constructor(pathTemplate:PathParams, value:Object) {
this.pathParameters = pathTemplate;
this.value = value;
}
public name():string{ return this.pathParameters.getName(); }
public valueAsString():string{ return String(this.value); }
public valueAsNumber():number{ return Number(this.value); }
public valueAsBoolean():boolean{ return Boolean.of(this.value); }
/***@override*/
public equals(o:Object):boolean{
if(!(o instanceof PathParam)) return false;
return this.value == o.value && this.name().equals(o.name());
}
/***@override*/
public toString():string{return `${this.pathParameters.toString()} = ${this.valueAsString()}`; }
}
Object.package(this);