isEqualTo (chain) {
    // check pointer
    if (chain === this) {
      return true
    }

    // check instance class
    if (!(chain instanceof Chain)) {
      return false
    }

    // compare string instance (fast)
    if (this._string !== null && this._string === chain._string) {
      return true
    }

    // try to compare code points
    if (this._codePoints !== null || chain._codePoints !== null) {
      return ArrayUtil.isEqual(this.getCodePoints(), chain.getCodePoints())
    }

    // try to compare strings
    if (this._string !== null || chain._string !== null) {
      return this.getString() === chain.getString()
    }

    // compare bytes
    return ArrayUtil.isEqual(this.getBytes(), chain.getBytes())
  }
/**
   * Returns true if this Chain's content is equal to given Chain's content.
   * Only encodes or decodes between text and bytes if necessary.
   * @param {?Chain} chain Chain to compare to.
   * @return {boolean} True, if content is equal.
   */
Returns true if this Chain's content is equal to given Chain's content.
Only encodes or decodes between text and bytes if necessary.
@param {?Chain} chain Chain to compare to.
@return {boolean} True, if content is equal.
Returns true if this Chain ' s content is equal to given Chain ' s content . Only encodes or decodes between text and bytes if necessary . @param { ?Chain } chain Chain to compare to . @return { boolean } True if content is equal .
isEqualTo (chain) {
    if (chain === this) {
      return true
    }
    if (!(chain instanceof Chain)) {
      return false
    }
    if (this._string !== null && this._string === chain._string) {
      return true
    }
    if (this._codePoints !== null || chain._codePoints !== null) {
      return ArrayUtil.isEqual(this.getCodePoints(), chain.getCodePoints())
    }
    if (this._string !== null || chain._string !== null) {
      return this.getString() === chain.getString()
    }
    return ArrayUtil.isEqual(this.getBytes(), chain.getBytes())
  }
isEqualTo ( chain ) { if ( chain === this ) { return true } if ( ! ( chain instanceof Chain ) ) { return false } if ( this . _string !== null && this . _string === chain . _string ) { return true } if ( this . _codePoints !== null || chain . _codePoints !== null ) { return ArrayUtil . isEqual ( this . getCodePoints ( ) , chain . getCodePoints ( ) ) } if ( this . _string !== null || chain . _string !== null ) { return this . getString ( ) === chain . getString ( ) } return ArrayUtil . isEqual ( this . getBytes ( ) , chain . getBytes ( ) ) }
Returns true if this Chain's content is equal to given Chain's content.
Returns true if this Chain ' s content is equal to given Chain ' s content .
// check pointer // check instance class // compare string instance (fast) // try to compare code points // try to compare strings // compare bytes