Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BookmarkRangeField

This is the class that encapsulates a bookmark range object.

Hierarchy

Index

Constructors

constructor

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

copyFrom

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

    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.

getEnd

  • This method returns the end bookmark of a range.

    Returns BookmarkField

    The end bookmark field of a range.

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.

getStart

  • This method returns the start bookmark of a range.

    Returns BookmarkField

    The start bookmark field of a range.

isEndInclusive

  • isEndInclusive(): boolean
  • This method returns whether the end of the range is inclusive or not.

    Returns boolean

    True if the end range is inclusive, false otherwise.

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.

isStartInclusive

  • isStartInclusive(): boolean
  • This method returns whether the start of the range is inclusive or not.

    Returns boolean

    True if the start range is inclusive, 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.

isValid

  • isValid(): boolean
  • This method returns whether this is a valid range or not.

    Returns boolean

    True if this is a valid range, false otherwise.

replaceStart

  • replaceStart(start: BookmarkField, makeExclusive?: boolean): void
  • This method replaces the start bookmark of the range.

    Parameters

    • start: BookmarkField

      The bookmark field object with the new start value.

    • Default value makeExclusive: boolean = true

      If true, the new start range should be exclusive, otherwise it keeps the previous value.

    Returns void

reset

  • reset(): void

toString

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

    Returns string

    The raw bookmark value.