Options
All
  • Public
  • Public/Protected
  • All
Menu

An abstract Typescript class to facilitate the creation of a concrete class targeted to a specific HTTP API.

HttpStatusCodeAbstractSubclass extends IanaHttpStatusCodes for its initial dataset that is then customizable by calling protected methods.

Hierarchy

Index

Constructors

Protected constructor

Public Methods

getDataset

getReasonPhrase

  • Get the reason phrase for the specified status code.

    When a status code has multiple records, returns the first reason phrase.

    Parameters

    • statusCode: number

    Returns ReasonPhrase

getReasonPhrases

  • Get all reason phrases for the specified status code.

    Parameters

    • statusCode: number

    Returns ReasonPhrase[]

getRecord

  • getRecord(statusCode: number): Record
  • Get a copy of the record for the specified status code.

    When a status code has multiple records, returns the first record.

    Parameters

    • statusCode: number

    Returns Record

getRecordForReasonPhrase

  • Get a status code's record that has the specified reason phrase.

    Parameters

    Returns Record

getRecords

  • Get all records for the specified status code.

    Parameters

    • statusCode: number

    Returns RecordSet

getReference

  • getReference(statusCode: number): Reference
  • Get the reference for the specified status code.

    When a status code has multiple records, returns the first reference.

    Parameters

    • statusCode: number

    Returns Reference

getReferenceForReasonPhrase

  • Get a status code's reference that has the specified reason phrase.

    Parameters

    Returns Reference

getReferences

  • getReferences(statusCode: number): Reference[]
  • Get all references for the specified status code regardless of reason phrase.

    Parameters

    • statusCode: number

    Returns Reference[]

getStatusCodes

  • getStatusCodes(): number[]

hasAlternatives

  • hasAlternatives(statusCode: number): boolean
  • Determine if the specified status code has multiple records.

    Parameters

    • statusCode: number

    Returns boolean

Protected Methods

Protected addRecord

  • addRecord(statusCode: number, record: Record): this
  • Add an alternative record for the specified status code.

    Parameters

    • statusCode: number
    • record: Record

    Returns this

Protected deleteRecord

  • deleteRecord(statusCode: number, reasonPhrase: ReasonPhrase): this
  • Delete the specified status code's record for the specified reason phrase.

    Parameters

    Returns this

Protected deleteStatusCode

  • deleteStatusCode(statusCode: number): this
  • Delete the specified status code from the dataset.

    Parameters

    • statusCode: number

    Returns this

Protected replaceReasonPhrase

  • Replace the specified status code's reason phrase.

    Parameters

    Returns this

Protected replaceRecord

  • Replace the specified status code's record for the specified reason phrase.

    Parameters

    Returns this

Protected replaceReference

  • Replace the specified status code's reference associated with the specified reason phrase.

    Parameters

    Returns this

Legend

  • Class
  • Method
  • Type alias
  • Inherited method
  • Protected method

Generated using TypeDoc