|
|
|
|
@ -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 { |
|
|
|
|
@ -21,13 +20,13 @@ public class Part { |
|
|
|
|
Type listType = new TypeToken<ArrayList<Part>>() {}.getType(); |
|
|
|
|
return new Gson().fromJson(str, listType); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
return Collections.emptyList(); |
|
|
|
|
return new ArrayList<>(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static List<String> get(String str) { |
|
|
|
|
List<String> items = new ArrayList<>(); |
|
|
|
|
if (TextUtils.isEmpty(str)) return Collections.emptyList(); |
|
|
|
|
if (TextUtils.isEmpty(str)) return items; |
|
|
|
|
for (Part item : arrayFrom(str)) items.add(item.getT()); |
|
|
|
|
return items; |
|
|
|
|
} |
|
|
|
|
|