Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
warriorzz committed Aug 8, 2021
1 parent 14573af commit 3707083
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/kotlin/com/github/warriorzz/ktify/model/Playlist.kt
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,16 @@ sealed class PlaylistTrackObject {
* Get the instance as a PlaylistTrack object
* @return Null if the instance is an PlaylistTrackRef
*/
fun asPlaylistTrack() : PlaylistTrack? = if (this is PlaylistTrack) this else null
fun asPlaylistTrack(): PlaylistTrack? = if (this is PlaylistTrack) this else null

/**
* Get the instance as a PlaylistTrackRef object
* @return Null if the instance is an PlaylistTrack
*/
fun asPlaylistTrackRef() : PlaylistTrackRef? = if (this is PlaylistTrackRef) this else null

fun asPlaylistTrackRef(): PlaylistTrackRef? = if (this is PlaylistTrackRef) this else null
}

object PlaylistTrackObjectSerializer: JsonContentPolymorphicSerializer<PlaylistTrackObject>(PlaylistTrackObject::class) {
object PlaylistTrackObjectSerializer : JsonContentPolymorphicSerializer<PlaylistTrackObject>(PlaylistTrackObject::class) {
override fun selectDeserializer(element: JsonElement): DeserializationStrategy<out PlaylistTrackObject> {
return if (element.jsonObject["track"] != null) PlaylistTrack.serializer() else PlaylistTrackRef.serializer()
}
Expand Down

0 comments on commit 3707083

Please sign in to comment.