OSDN Git Service

リファクタリング.
[coroid/inqubus.git] / frontend / src / saccubus / net / VideoInfo.java
1 /*
2  * To change this template, choose Tools | Templates
3  * and open the template in the editor.
4  */
5 package saccubus.net;
6
7 /**
8  *
9  * @author yuki
10  */
11 public class VideoInfo {
12
13     private final String videoTitle;
14     private final String threadId;
15     private final String videoUrl;
16     private final String msgUrl;
17     private final String userId;
18     private final int videoLength;
19     private final OfficialOption officialOption;
20
21     /**
22      *
23      * @param videoTitle
24      * @param threadId
25      * @param videoUrl
26      * @param msgUrl
27      * @param userId
28      * @param videoLength
29      * @param officialOption nullも可.
30      */
31     VideoInfo(String videoTitle, String threadId, String videoUrl, String msgUrl, String userId, int videoLength,
32             OfficialOption officialOption) {
33         if (videoTitle == null || threadId == null || videoUrl == null || msgUrl == null || userId == null) {
34             throw new IllegalArgumentException("video informationの情報が不正です。");
35         }
36         this.videoTitle = videoTitle;
37         this.threadId = threadId;
38         this.videoUrl = videoUrl;
39         this.msgUrl = msgUrl;
40         this.userId = userId;
41         this.videoLength = videoLength;
42         this.officialOption = officialOption;
43     }
44
45     public String getMsgUrl() {
46         return msgUrl;
47     }
48
49     public String getThreadId() {
50         return threadId;
51     }
52
53     public String getUserId() {
54         return userId;
55     }
56
57     public int getVideoLength() {
58         return videoLength;
59     }
60
61     public String getVideoTitle() {
62         return videoTitle;
63     }
64
65     public String getVideoUrl() {
66         return videoUrl;
67     }
68
69     public OfficialOption getOfficialOption() {
70         return officialOption;
71     }
72
73     public static class OfficialOption {
74
75         private final String threadKey;
76         private final String force184;
77
78         public OfficialOption(String threadKey, String force184) {
79             if (threadKey == null || force184 == null) {
80                 throw new IllegalArgumentException("公式動画用キーが不正です");
81             }
82             this.threadKey = threadKey;
83             this.force184 = force184;
84         }
85
86         public String getThreadKey() {
87             return threadKey;
88         }
89
90         public String getForce184() {
91             return force184;
92         }
93     }
94 }