Skip to content

Commit 1b35370

Browse files
authored
Add SpotifyUri#equals(any: Any?)
1 parent 9a391ae commit 1b35370

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/kotlin/com/adamratzman/spotify/utils/SpotifyUris.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ sealed class SpotifyUri(input: String, type: String) {
3737
this.id = it.remove(type)
3838
}
3939
}
40+
41+
override fun equals(other: Any?): Boolean {
42+
val spotifyUri = other as? SpotifyUri ?: return false
43+
return spotifyUri.uri == this.uri
44+
}
4045
}
4146

4247
/**
@@ -77,4 +82,4 @@ class UserURI(input: String) : SpotifyUri(input, "user")
7782
* @property uri retrieve this URI as a string
7883
* @property id representation of this uri as an id
7984
*/
80-
class PlaylistURI(input: String) : SpotifyUri(input, "playlist")
85+
class PlaylistURI(input: String) : SpotifyUri(input, "playlist")

0 commit comments

Comments
 (0)