-
Notifications
You must be signed in to change notification settings - Fork 563
/
MediaContent.java
75 lines (60 loc) · 1.77 KB
/
MediaContent.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package data.media;
import com.dslplatform.json.CompiledJson;
import com.dslplatform.json.JsonAttribute;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.List;
@SuppressWarnings("serial")
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
@CompiledJson(formats = {CompiledJson.Format.ARRAY, CompiledJson.Format.OBJECT})
public class MediaContent implements java.io.Serializable
{
public Media media;
public List<Image> images;
public MediaContent() {}
public MediaContent (Media media, List<Image> images) {
this.media = media;
this.images = images;
}
@Override
public boolean equals(Object o)
{
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
MediaContent that = (MediaContent) o;
if (images != null ? !images.equals(that.images) : that.images != null) return false;
if (media != null ? !media.equals(that.media) : that.media != null) return false;
return true;
}
@Override
public int hashCode()
{
int result = media != null ? media.hashCode() : 0;
result = 31 * result + (images != null ? images.hashCode() : 0);
return result;
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("[MediaContent: ");
sb.append("media=").append(media);
sb.append(", images=").append(images);
sb.append("]");
return sb.toString();
}
public void setMedia(Media media) {
this.media = media;
}
public void setImages(List<Image> images) {
this.images = images;
}
@JsonAttribute(index = 1)
public Media getMedia() {
return media;
}
@JsonAttribute(index = 2)
public List<Image> getImages() {
return images;
}
}