Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a boolean[1] value in an Ion stream.

Because this class extends Javascript's (big-B) Boolean data type, it is subject to the same surprising behavior when used for control flow.

From the Mozilla Developer Network documentation[2]:

Any object of which the value is not undefined or null, including a Boolean object whose value is false, evaluates to true when passed to a conditional statement.

     var b = false;
     if (b) {
         // this code will NOT be executed
     }

     b = new Boolean(false);
     if (b) {
         // this code WILL be executed
     }

[1] https://amazon-ion.github.io/ion-docs/docs/spec.html#bool [2] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean#Description

Hierarchy

  • __type<BooleanConstructor, this> & Boolean
    • Boolean

Index

Constructors

constructor

  • new Boolean(value: boolean, annotations?: string[]): Boolean
  • Constructor.

    Parameters

    • value: boolean

      The boolean value of the new instance.

    • annotations: string[] = []

      An optional array of strings to associate with value.

    Returns Boolean

Properties

_ionAnnotations

_ionAnnotations: string[]

_ionType

_ionType: IonType

Methods

_setAnnotations

  • _setAnnotations(annotations: string[]): void
  • Parameters

    • annotations: string[]

    Returns void

_unsupportedOperation

  • _unsupportedOperation<T>(functionName: string): never
  • Type parameters

    Parameters

    • functionName: string

    Returns never

_valueEquals

  • _valueEquals(other: any, options?: { epsilon?: null | number; ignoreAnnotations?: boolean; ignoreTimestampPrecision?: boolean; onlyCompareIon?: boolean }): boolean
  • Parameters

    • other: any
    • options: { epsilon?: null | number; ignoreAnnotations?: boolean; ignoreTimestampPrecision?: boolean; onlyCompareIon?: boolean } = ...
      • Optional epsilon?: null | number
      • Optional ignoreAnnotations?: boolean
      • Optional ignoreTimestampPrecision?: boolean
      • Optional onlyCompareIon?: boolean

    Returns boolean

allFields

  • allFields(): [string, Value[]][]
  • Returns [string, Value[]][]

as

  • Type parameters

    Parameters

    Returns T

bigIntValue

  • bigIntValue(): null | bigint
  • Returns null | bigint

booleanValue

  • booleanValue(): boolean
  • Returns boolean

dateValue

  • dateValue(): null | Date
  • Returns null | Date

decimalValue

  • Returns null | Decimal

deleteField

  • deleteField(name: string): boolean
  • Parameters

    • name: string

    Returns boolean

elements

  • Returns Value[]

equals

  • equals(other: any, options?: { epsilon?: null | number }): boolean
  • Implementation of the dom.Value interface method equals()

    Parameters

    • other: any
    • options: { epsilon?: null | number } = ...
      • Optional epsilon?: null | number

    Returns boolean

fieldNames

  • fieldNames(): string[]
  • Returns string[]

fields

  • fields(): [string, Value][]
  • Returns [string, Value][]

get

getAll

  • Parameters

    Returns null | Value[]

getAnnotations

  • getAnnotations(): string[]
  • Returns string[]

getType

ionEquals

  • ionEquals(other: Value, options?: { epsilon?: null | number; ignoreAnnotations?: boolean; ignoreTimestampPrecision?: boolean }): boolean
  • Implementation of the dom.Value interface method ionEquals()

    Parameters

    • other: Value
    • options: { epsilon?: null | number; ignoreAnnotations?: boolean; ignoreTimestampPrecision?: boolean } = ...
      • Optional epsilon?: null | number
      • Optional ignoreAnnotations?: boolean
      • Optional ignoreTimestampPrecision?: boolean

    Returns boolean

isNull

  • isNull(): boolean
  • Returns boolean

numberValue

  • numberValue(): null | number
  • Returns null | number

stringValue

  • stringValue(): null | string
  • Returns null | string

timestampValue

  • Returns null | Timestamp

uInt8ArrayValue

  • uInt8ArrayValue(): null | Uint8Array
  • Returns null | Uint8Array

valueOf

  • valueOf(): Object
  • valueOf(): boolean
  • Returns the primitive value of the specified object.

    Returns Object

  • Returns the primitive value of the specified object.

    Returns boolean

writeTo

  • writeTo(writer: Writer): void
  • Parameters

    Returns void

Static _fromJsValue

  • _fromJsValue(jsValue: any, annotations: string[]): Value
  • Parameters

    • jsValue: any
    • annotations: string[]

    Returns Value

Static _getIonType