import PositiveNumber from "../PositiveNumber";
import Typeof from "../Typeof";
export default class StatusCode {
    get statusCode() {
        return this._statusCode;
    }
    set statusCode(v) {
        this._statusCode = v;
    }
    constructor(statusCode) {
        this._statusCode = new PositiveNumber(200);
        if (statusCode) {
            this.statusCode = new PositiveNumber(statusCode);
        }
    }
    toString() {
        return this.statusCode.toString();
    }
    toNumber() {
        return this.statusCode.toNumber();
    }
    static isValidStatusCode(statusCode) {
        try {
            if (typeof statusCode === Typeof.String) {
                statusCode = parseInt(statusCode);
            }
            if (statusCode >= 100 && statusCode <= 599) {
                return true;
            }
            return false;
        }
        catch (_a) {
            return false;
        }
    }
}
//# sourceMappingURL=StatusCode.js.map