diff --git a/ultrasonic/src/main/java/org/moire/ultrasonic/domain/Lyrics.java b/ultrasonic/src/main/java/org/moire/ultrasonic/domain/Lyrics.java deleted file mode 100644 index 47d07245..00000000 --- a/ultrasonic/src/main/java/org/moire/ultrasonic/domain/Lyrics.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - This file is part of Subsonic. - - Subsonic is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Subsonic is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Subsonic. If not, see . - - Copyright 2010 (C) Sindre Mehus - */ -package org.moire.ultrasonic.domain; - -/** - * Song lyrics. - * - * @author Sindre Mehus - */ -public class Lyrics -{ - - private String artist; - private String title; - private String text; - - public String getArtist() - { - return artist; - } - - public void setArtist(String artist) - { - this.artist = artist; - } - - public String getTitle() - { - return title; - } - - public void setTitle(String title) - { - this.title = title; - } - - public String getText() - { - return text; - } - - public void setText(String text) - { - this.text = text; - } -} diff --git a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/domain/APILyricsConverter.kt b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/domain/APILyricsConverter.kt index 8250dc21..2bebc6bb 100644 --- a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/domain/APILyricsConverter.kt +++ b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/domain/APILyricsConverter.kt @@ -5,8 +5,8 @@ package org.moire.ultrasonic.domain import org.moire.ultrasonic.api.subsonic.models.Lyrics as APILyrics -fun APILyrics.toDomainEntity(): Lyrics = Lyrics().apply { - artist = this@toDomainEntity.artist - title = this@toDomainEntity.title +fun APILyrics.toDomainEntity(): Lyrics = Lyrics( + artist = this@toDomainEntity.artist, + title = this@toDomainEntity.title, text = this@toDomainEntity.text -} +) diff --git a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/domain/Lyrics.kt b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/domain/Lyrics.kt new file mode 100644 index 00000000..6c4315f1 --- /dev/null +++ b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/domain/Lyrics.kt @@ -0,0 +1,10 @@ +package org.moire.ultrasonic.domain + +/** + * Song lyrics. + */ +data class Lyrics( + val artist: String? = null, + val title: String? = null, + val text: String? = null +) diff --git a/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APILyricsConverterTest.kt b/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APILyricsConverterTest.kt index 07a5260a..eb72481c 100644 --- a/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APILyricsConverterTest.kt +++ b/ultrasonic/src/test/kotlin/org/moire/ultrasonic/domain/APILyricsConverterTest.kt @@ -2,7 +2,7 @@ package org.moire.ultrasonic.domain -import org.amshove.kluent.`should equal to` +import org.amshove.kluent.`should equal` import org.junit.Test import org.moire.ultrasonic.api.subsonic.models.Lyrics @@ -17,9 +17,9 @@ class APILyricsConverterTest { val convertedEntity = entity.toDomainEntity() with(convertedEntity) { - artist `should equal to` entity.artist - title `should equal to` entity.title - text `should equal to` entity.text + artist `should equal` entity.artist + title `should equal` entity.title + text `should equal` entity.text } } }