root/trunk/cdmlib/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/media/MovieFile.java

Revision 10919, 1.8 kB (checked in by a.mueller, 18 months ago)

merge 3.0.2 to trunk

  • Property svn:keywords set to Id
Line 
1/**
2* Copyright (C) 2007 EDIT
3* European Distributed Institute of Taxonomy
4* http://www.e-taxonomy.eu
5*
6* The contents of this file are subject to the Mozilla Public License Version 1.1
7* See LICENSE.TXT at the top of this package for the full license terms.
8*/
9
10package eu.etaxonomy.cdm.model.media;
11
12import java.net.URI;
13
14import org.apache.log4j.Logger;
15import org.hibernate.envers.Audited;
16
17
18import javax.persistence.*;
19import javax.xml.bind.annotation.XmlAccessType;
20import javax.xml.bind.annotation.XmlAccessorType;
21import javax.xml.bind.annotation.XmlElement;
22import javax.xml.bind.annotation.XmlRootElement;
23import javax.xml.bind.annotation.XmlType;
24
25/**
26 * @author m.doering
27 * @version 1.0
28 * @created 08-Nov-2007 13:06:35
29 */
30@XmlAccessorType(XmlAccessType.FIELD)
31@XmlType(name = "MovieFile", propOrder = {
32    "duration"
33})
34@XmlRootElement(name = "MovieFile")
35@Entity
36@Audited
37public class MovieFile extends MediaRepresentationPart {
38        private static final long serialVersionUID = 8650308822737671731L;
39        private static final Logger logger = Logger.getLogger(MovieFile.class);
40       
41        //Length of movie in seconds
42        @XmlElement(name = "Duration")
43        private int duration;
44
45        public static MovieFile NewInstance(URI uri, Integer size){
46                logger.debug("NewInstance");
47                return new MovieFile(uri, size);
48        }
49       
50        /**
51         * Factory method
52         * @return
53         */
54        public static MovieFile NewInstance(){
55                return new MovieFile();
56        }
57       
58        /**
59         * Constructor
60         */
61        protected MovieFile() {
62                super();
63        }
64       
65        /**
66         * Constructor
67         */
68        protected MovieFile(URI uri, Integer size) {
69                super(uri, size);
70        }
71       
72       
73        /**
74         * The Length of the movie in seconds
75         *
76         * @return
77         */
78        public int getDuration(){
79                return this.duration;
80        }
81
82        /**
83         * Sets the Length of the movie in seconds
84         * @param duration    duration
85         */
86        public void setDuration(int duration){
87                this.duration = duration;
88        }
89
90}
Note: See TracBrowser for help on using the browser.