mirror of https://github.com/FongMi/TV.git
parent
1a4d14da59
commit
6a6ec6a04a
@ -0,0 +1,32 @@ |
||||
package com.fongmi.android.tv.bean; |
||||
|
||||
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.Collections; |
||||
import java.util.List; |
||||
|
||||
public class Rule { |
||||
|
||||
@SerializedName("hosts") |
||||
private List<String> hosts; |
||||
@SerializedName("regex") |
||||
private List<String> regex; |
||||
|
||||
public static List<Rule> arrayFrom(JsonElement element) { |
||||
Type listType = new TypeToken<List<Rule>>() {}.getType(); |
||||
List<Rule> items = new Gson().fromJson(element, listType); |
||||
return items == null ? Collections.emptyList() : items; |
||||
} |
||||
|
||||
public List<String> getHosts() { |
||||
return hosts == null ? Collections.emptyList() : hosts; |
||||
} |
||||
|
||||
public List<String> getRegex() { |
||||
return regex == null ? Collections.emptyList() : regex; |
||||
} |
||||
} |
||||
@ -1,11 +1,10 @@ |
||||
package com.fongmi.android.tv.impl; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
public interface ParseCallback { |
||||
|
||||
void onParseSuccess(List<String> ads, Map<String, String> headers, String url, String from); |
||||
void onParseSuccess(Map<String, String> headers, String url, String from); |
||||
|
||||
void onParseError(); |
||||
} |
||||
|
||||
@ -1,10 +0,0 @@ |
||||
package com.fongmi.android.tv.impl; |
||||
|
||||
import java.util.Map; |
||||
|
||||
public interface WebCallback { |
||||
|
||||
void onSniffSuccess(Map<String, String> headers, String url, String from); |
||||
|
||||
void onSniffError(); |
||||
} |
||||
Loading…
Reference in new issue