|
|
|
|
@ -5,12 +5,12 @@ import android.os.Parcelable; |
|
|
|
|
import android.text.TextUtils; |
|
|
|
|
|
|
|
|
|
import com.github.catvod.utils.Trans; |
|
|
|
|
import com.google.common.base.Predicates; |
|
|
|
|
import com.google.common.collect.Iterables; |
|
|
|
|
import com.google.gson.Gson; |
|
|
|
|
import com.google.gson.JsonElement; |
|
|
|
|
import com.google.gson.annotations.SerializedName; |
|
|
|
|
import com.google.gson.reflect.TypeToken; |
|
|
|
|
|
|
|
|
|
import java.lang.reflect.Type; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Collections; |
|
|
|
|
import java.util.List; |
|
|
|
|
@ -30,12 +30,6 @@ public class Filter implements Parcelable { |
|
|
|
|
return new Gson().fromJson(element, Filter.class); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static List<Filter> arrayFrom(String str) { |
|
|
|
|
Type listType = new TypeToken<List<Filter>>() {}.getType(); |
|
|
|
|
List<Filter> items = new Gson().fromJson(str, listType); |
|
|
|
|
return items == null ? Collections.emptyList() : items; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Filter() { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -61,6 +55,11 @@ public class Filter implements Parcelable { |
|
|
|
|
return v; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Filter check() { |
|
|
|
|
Iterables.removeIf(getValue(), Predicates.isNull()); |
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Filter trans() { |
|
|
|
|
if (Trans.pass()) return this; |
|
|
|
|
for (Value value : getValue()) value.trans(); |
|
|
|
|
|