View Javadoc
1   /*
2    * Licensed to The Apereo Foundation under one or more contributor license
3    * agreements. See the NOTICE file distributed with this work for additional
4    * information regarding copyright ownership.
5    *
6    *
7    * The Apereo Foundation licenses this file to you under the Educational
8    * Community License, Version 2.0 (the "License"); you may not use this file
9    * except in compliance with the License. You may obtain a copy of the License
10   * at:
11   *
12   *   http://opensource.org/licenses/ecl2.txt
13   *
14   * Unless required by applicable law or agreed to in writing, software
15   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
17   * License for the specific language governing permissions and limitations under
18   * the License.
19   *
20   */
21  
22  package org.opencastproject.composer.api;
23  
24  import java.util.List;
25  
26  import javax.xml.bind.annotation.XmlAccessType;
27  import javax.xml.bind.annotation.XmlAccessorType;
28  import javax.xml.bind.annotation.XmlElement;
29  import javax.xml.bind.annotation.XmlRootElement;
30  import javax.xml.bind.annotation.XmlType;
31  
32  /**
33   * A JAXB annotated collection wrapper for {@link EncodingProfileImpl}s.
34   */
35  @XmlAccessorType(XmlAccessType.FIELD)
36  @XmlType(name = "profiles", namespace = "http://composer.opencastproject.org")
37  @XmlRootElement(name = "profiles", namespace = "http://composer.opencastproject.org")
38  public class EncodingProfileList {
39  
40    public EncodingProfileList() {
41    }
42  
43    public EncodingProfileList(List<EncodingProfileImpl> list) {
44      this.profiles = list;
45    }
46  
47    @XmlElement(name = "profile")
48    protected List<EncodingProfileImpl> profiles;
49  
50    public List<EncodingProfileImpl> getProfiles() {
51      return profiles;
52    }
53  
54    public void setProfiles(List<EncodingProfileImpl> profiles) {
55      this.profiles = profiles;
56    }
57  
58    @Override
59    public int hashCode() {
60      final int prime = 31;
61      int result = 1;
62      result = prime * result + ((profiles == null) ? 0 : profiles.hashCode());
63      return result;
64    }
65  
66    @Override
67    public boolean equals(Object obj) {
68      if (this == obj)
69        return true;
70      if (obj == null)
71        return false;
72      if (getClass() != obj.getClass())
73        return false;
74      EncodingProfileList other = (EncodingProfileList) obj;
75      if (profiles == null) {
76        if (other.profiles != null)
77          return false;
78      } else if (!profiles.equals(other.profiles))
79        return false;
80      return true;
81    }
82  
83  }