getHashCode method

int getHashCode(
  1. DateTimeZone obj
)

Returns a hash code for the specified time zone.

The hash code generated by any instance of ZoneEqualityComparer will be equal to the hash code generated by any other instance constructed with the same options and interval, for the same time zone (or equal ones). Two instances of ZoneEqualityComparer with different options or intervals may (but may not) produce different hash codes for the same zone.

obj: The time zone to compute a hash code for. Returns: A hash code for the specified object.

Implementation

int getHashCode(DateTimeZone obj) {
  Preconditions.checkNotNull(obj, 'obj');
  return hashObjects(
      _getIntervals(obj)
          .map((zoneInterval) => _zoneIntervalComparer.getHashCode(zoneInterval))
  );
}