specialize

protected abstract LogSiteKey specialize(LogSiteKey key)

Returns a specialization of the given key which accounts for this scope instance. Two specialized keys should compare as equals if and only if they are specializations from the same log site, with the same sequence of scopes applied.

The returned instance:

  • Must be an immutable "value type".
  • Must not compare as equals to the given key.
  • Should have a different hashCode to the given key.
  • Should be efficient and lightweight.
As such it is recommended that the of method is used in implementations, passing in a suitable qualifier (which need not be the scope itself, but must be unique per scope).