Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BookmarkField

This is the class that encapsulates a bookmark object (which consists of a publisher id and a sequence number).

Hierarchy

Index

Constructors

constructor

  • Parameters

    • Default value raw: string = null

      The raw bookmark string of a format: 10357694053628526720|1490901822670001000|.

    Returns BookmarkField

Properties

length

length: number = 0

Protected publisherId

publisherId: string = null

Protected raw

raw: string

The raw bookmark string of a format: 10357694053628526720|1490901822670001000|.

Protected sequenceNumber

sequenceNumber: BigInteger = null

Static MAX_BOOKMARK_LENGTH

MAX_BOOKMARK_LENGTH: number = 42

Static MAX_TIMESTAMP_LENGTH

MAX_TIMESTAMP_LENGTH: number = 24

Static MIN_TIMESTAMP_LENGTH

MIN_TIMESTAMP_LENGTH: number = 10

Methods

copy

  • This method provides a way to duplicate this object.

    Returns BookmarkField

    The copied bookmark field object.

copyFrom

  • This method provides a way to make this object a duplicate of a field if the field represents a valid bookmark.

    Parameters

    Returns void

equals

  • This method compares the current object with another object.

    Parameters

    • field: BookmarkField | string

      Another bookmark field object or a string raw bookmark.

    Returns boolean

    True if the two objects are equal, false otherwise.

getPublisherId

  • getPublisherId(): string
  • Returns the publisher id for the bookmark or 0 if it's a timestamp.

    Returns string

    The corresponding publisher id for this bookmark or null if it's a timestamp or a range value.

getSequenceNumber

  • This method returns the sequence number for the bookmark or 0 if it's a timestamp or a range value.

    Returns BigInteger

    The corresponding sequence number for this bookmark.

isNull

  • isNull(): boolean
  • This method returns whether it's clear/reset or not.

    Returns boolean

    True if the object is "null" (reset), false otherwise.

isRange

  • isRange(): boolean
  • This method identifies if this bookmark represents a range value. Only checks for starting [( and ending ]) so not a full validation. Example of a range value: [20150102T122500Z:20150102T123500Z]

    Returns boolean

    True if the bokmark field is a range bookmark value, false otherwise.

isTimestamp

  • isTimestamp(): boolean
  • This method identifies if this bookmark represents a timestamp. Example of a timestamp: 20150102T123500Z

    Returns boolean

    True if the bokmark field is a timestamp, false otherwise.

reset

  • reset(): void
  • This method resets/clears this object.

    Returns void

toString

  • toString(): string
  • This method returns the raw bookmark value as a string.

    Returns string

    The raw bookmark value.