Remove GSON lib
This commit is contained in:
parent
0b29cf086b
commit
b494b2ea39
6 changed files with 39 additions and 76 deletions
|
|
@ -4,9 +4,6 @@ import android.support.annotation.NonNull;
|
|||
import android.support.annotation.Nullable;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
|
||||
import org.schabi.newpipe.playlist.PlayQueue;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -41,21 +38,6 @@ public class PlayerState implements Serializable {
|
|||
// Serdes
|
||||
//////////////////////////////////////////////////////////////////////////*/
|
||||
|
||||
@Nullable
|
||||
public static PlayerState fromJson(@NonNull final String json) {
|
||||
try {
|
||||
return new Gson().fromJson(json, PlayerState.class);
|
||||
} catch (JsonSyntaxException error) {
|
||||
Log.e(TAG, "Failed to deserialize PlayerState from json=[" + json + "]", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String toJson() {
|
||||
return new Gson().toJson(this);
|
||||
}
|
||||
|
||||
/*//////////////////////////////////////////////////////////////////////////
|
||||
// Getters
|
||||
//////////////////////////////////////////////////////////////////////////*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue