001/*
002 * (C) Copyright 2015 Nuxeo SA (http://nuxeo.com/) and contributors.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser General Public License
006 * (LGPL) version 2.1 which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/lgpl-2.1.html
008 *
009 * This library is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012 * Lesser General Public License for more details.
013 *
014 * Contributors:
015 *      André Justo
016 */
017
018package org.nuxeo.ecm.media.publishing.wistia.model;
019
020import org.codehaus.jackson.annotate.JsonIgnoreProperties;
021import org.codehaus.jackson.annotate.JsonProperty;
022
023import java.util.ArrayList;
024import java.util.Date;
025import java.util.List;
026
027@JsonIgnoreProperties(ignoreUnknown = true)
028public class Project {
029
030    protected int id;
031
032    protected String name;
033
034    protected String description;
035
036    protected int mediaCount;
037
038    @JsonProperty("created")
039    protected Date createdAt;
040
041    @JsonProperty("updated")
042    protected Date updatedAt;
043
044    protected String hashedId;
045
046    protected boolean anonymousCanUpload;
047
048    protected boolean anonymousCanDownload;
049
050    protected boolean isPublic;
051
052    protected String publicId;
053
054    protected List<Media> medias = new ArrayList<Media>();
055
056    public int getId() {
057        return id;
058    }
059
060    public void setId(int id) {
061        this.id = id;
062    }
063
064    public String getName() {
065        return name;
066    }
067
068    public void setName(String name) {
069        this.name = name;
070    }
071
072    public String getDescription() {
073        return description;
074    }
075
076    public void setDescription(String description) {
077        this.description = description;
078    }
079
080    public int getMediaCount() {
081        return mediaCount;
082    }
083
084    public void setMediaCount(int mediaCount) {
085        this.mediaCount = mediaCount;
086    }
087
088    public Date getCreatedAt() {
089        return createdAt;
090    }
091
092    public void setCreatedAt(Date createdAt) {
093        this.createdAt = createdAt;
094    }
095
096    public Date getUpdatedAt() {
097        return updatedAt;
098    }
099
100    public void setUpdatedAt(Date updatedAt) {
101        this.updatedAt = updatedAt;
102    }
103
104    public String getHashedId() {
105        return hashedId;
106    }
107
108    public void setHashedId(String hashedId) {
109        this.hashedId = hashedId;
110    }
111
112    public boolean getAnonymousCanUpload() {
113        return anonymousCanUpload;
114    }
115
116    public void setAnonymousCanUpload(boolean anonymousCanUpload) {
117        this.anonymousCanUpload = anonymousCanUpload;
118    }
119
120    public boolean getAnonymousCanDownload() {
121        return anonymousCanDownload;
122    }
123
124    public void setAnonymousCanDownload(boolean anonymousCanDownload) {
125        this.anonymousCanDownload = anonymousCanDownload;
126    }
127
128    public boolean isPublic() {
129        return isPublic;
130    }
131
132    public void setPublic(boolean isPublic) {
133        this.isPublic = isPublic;
134    }
135
136    public String getPublicId() {
137        return publicId;
138    }
139
140    public void setPublicId(String publicId) {
141        this.publicId = publicId;
142    }
143
144    public void addMedia(Media media) {
145        this.medias.add(media);
146    }
147
148    public List<Media> getMedias() {
149        return this.medias;
150    }
151
152    @Override
153    public String toString() {
154        return "--- Project info ---" +
155                "\nid: \t" + getId() +
156                "\nname: \t" + getName() +
157                "\ndescription: \t" + getDescription() +
158                "\nmediaCount: \t" + getMediaCount() +
159                "\nhashedId: \t" + getHashedId() +
160                "\nanonymousCanUpload: \t" + getAnonymousCanUpload() +
161                "\nanonymousCanDownload: \t" + getAnonymousCanDownload() +
162                "\nisPublic: \t" + isPublic() + "\n";
163    }
164}