| 3 | import com.google.gson.annotations.SerializedName; |
| 4 | |
| 5 | public class Sub { |
| 6 | |
| 7 | @SerializedName("url") |
| 8 | private String url; |
| 9 | @SerializedName("name") |
| 10 | private String name; |
| 11 | @SerializedName("lang") |
| 12 | private String lang; |
| 13 | @SerializedName("format") |
| 14 | private String format; |
| 15 | @SerializedName("flag") |
| 16 | private int flag; |
| 17 | |
| 18 | public static Sub create() { |
| 19 | return new Sub(); |
| 20 | } |
| 21 | |
| 22 | public Sub name(String name) { |
| 23 | this.name = name; |
| 24 | return this; |
| 25 | } |
| 26 | |
| 27 | public Sub url(String url) { |
| 28 | this.url = url; |
| 29 | return this; |
| 30 | } |
| 31 | |
| 32 | public Sub lang(String lang) { |
| 33 | this.lang = lang; |
| 34 | return this; |
| 35 | } |
| 36 | |
| 37 | private Sub format(String format) { |
| 38 | this.format = format; |
| 39 | return this; |
| 40 | } |
| 41 | |
| 42 | public Sub forced() { |
| 43 | this.flag = 2; |
| 44 | return this; |
| 45 | } |
| 46 | |
| 47 | public Sub ext(String ext) { |
| 48 | switch (ext) { |
| 49 | case "vtt": |
| 50 | return format("text/vtt"); |
| 51 | case "ass": |
| 52 | case "ssa": |
| 53 | return format("text/x-ssa"); |
| 54 | default: |
| 55 | return format("application/x-subrip"); |
| 56 | } |
| 57 | } |
| 58 | } |
nothing calls this directly
no outgoing calls
no test coverage detected