iheartradio / open-m3u8

Open Source m3u8 Parser
Other
248 stars 94 forks source link

hashCode() and equals() method for all data containers as per #11 #12

Closed derjust closed 9 years ago

derjust commented 9 years ago

hashCode() and equals() method for all data containers as per #11

Wopple commented 9 years ago

The equals implementations can definitely be cleaned up with ObjectUtil.equals. See MediaData.equals for reference.

Wopple commented 9 years ago

Oh, it looks like you removed ObjectUtil. Why was that?

derjust commented 9 years ago

I think those equals methods are easier to debug and have those quick-checks at the beginning (different class or same object) which make them "better". But that is for sure a very subjective opinion. Happy to use your ObjectUtils approach (any reason to use that as it looks like it is also part of Dravik: https://developer.android.com/reference/java/util/Objects.html ?)

Wopple commented 9 years ago

I was unaware of the Objects class. Yes, please make use of it! +1

We will optimize when performance becomes an issue in practice. For now, let's keep the code clean.

derjust commented 9 years ago

Please review whenever it fits. Followed old concept of ObjectUtil but replaced it with its counterpart from JDK1.7 / Dravik doing the exact same code. (And rebased to most recent master)