Can be simplified to:
```
return (name.hashCode() * 31 + type) * 31 + dnsClass;
```