equals method

bool equals(
  1. MarshalledObject? other
)

Structurally compares object for equality.

Implementation

bool equals(MarshalledObject? other)
{
  if (other == null) {
    return false;
  }

  if ( isNull() || other.isNull() ) {
    return isNull() == other.isNull();
  }

  if ( isArray() || other.isArray() ) {
    if ( isArray() != other.isArray() ) {
      return false;
    }
    return asArray().equals( other.asArray() );
  }

  if ( isObject() || other.isObject() ) {
    if ( isObject() != other.isObject() ) {
      return false;
    }
    return _objectEquals(other);
  }

  return getRawValue() == other.getRawValue();
}