|
|
|
|
@ -8,7 +8,6 @@ import com.google.gson.reflect.TypeToken; |
|
|
|
|
|
|
|
|
|
import java.lang.reflect.Type; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Collections; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
public class Part { |
|
|
|
|
@ -17,9 +16,12 @@ public class Part { |
|
|
|
|
private String t; |
|
|
|
|
|
|
|
|
|
private static List<Part> arrayFrom(String str) { |
|
|
|
|
Type listType = new TypeToken<List<Part>>() {}.getType(); |
|
|
|
|
List<Part> items = new Gson().fromJson(str, listType); |
|
|
|
|
return items == null ? Collections.emptyList() : items; |
|
|
|
|
try { |
|
|
|
|
Type listType = new TypeToken<ArrayList<Part>>() {}.getType(); |
|
|
|
|
return new Gson().fromJson(str, listType); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
return new ArrayList<>(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static List<String> get(String str) { |
|
|
|
|
|