mirror of
https://github.com/CappielloAntonio/tempo.git
synced 2026-01-31 06:42:06 +00:00
Code refactor in ServerRepository
This commit is contained in:
@@ -5,18 +5,15 @@ import android.app.Application;
|
||||
import androidx.lifecycle.LiveData;
|
||||
|
||||
import com.cappielloantonio.play.database.AppDatabase;
|
||||
import com.cappielloantonio.play.database.dao.QueueDao;
|
||||
import com.cappielloantonio.play.database.dao.ServerDao;
|
||||
import com.cappielloantonio.play.model.Server;
|
||||
import com.cappielloantonio.play.model.Song;
|
||||
import com.cappielloantonio.play.util.QueueUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ServerRepository {
|
||||
private static final String TAG = "QueueRepository";
|
||||
|
||||
private ServerDao serverDao;
|
||||
private final ServerDao serverDao;
|
||||
|
||||
public ServerRepository(Application application) {
|
||||
AppDatabase database = AppDatabase.getInstance(application);
|
||||
@@ -40,8 +37,8 @@ public class ServerRepository {
|
||||
}
|
||||
|
||||
private static class InsertThreadSafe implements Runnable {
|
||||
private ServerDao serverDao;
|
||||
private Server server;
|
||||
private final ServerDao serverDao;
|
||||
private final Server server;
|
||||
|
||||
public InsertThreadSafe(ServerDao serverDao, Server server) {
|
||||
this.serverDao = serverDao;
|
||||
@@ -55,8 +52,8 @@ public class ServerRepository {
|
||||
}
|
||||
|
||||
private static class DeleteThreadSafe implements Runnable {
|
||||
private ServerDao serverDao;
|
||||
private Server server;
|
||||
private final ServerDao serverDao;
|
||||
private final Server server;
|
||||
|
||||
public DeleteThreadSafe(ServerDao serverDao, Server server) {
|
||||
this.serverDao = serverDao;
|
||||
|
||||
Reference in New Issue
Block a user