/******************************************************************************* | |
* Copyright (c) 2013-2015 LAAS-CNRS (www.laas.fr) | |
* 7 Colonel Roche 31077 Toulouse - France | |
* | |
* All rights reserved. This program and the accompanying materials | |
* are made available under the terms of the Eclipse Public License v1.0 | |
* which accompanies this distribution, and is available at | |
* http://www.eclipse.org/legal/epl-v10.html | |
* | |
* Contributors: | |
* Thierry Monteil (Project co-founder) - Management and initial specification, | |
* conception and documentation. | |
* Mahdi Ben Alaya (Project co-founder) - Management and initial specification, | |
* conception, implementation, test and documentation. | |
* Christophe Chassot - Management and initial specification. | |
* Khalil Drira - Management and initial specification. | |
* Yassine Banouar - Initial specification, conception, implementation, test | |
* and documentation. | |
* Guillaume Garzone - Conception, implementation, test and documentation. | |
* Francois Aissaoui - Conception, implementation, test and documentation. | |
******************************************************************************/ | |
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 | |
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> | |
// Any modifications to this file will be lost upon recompilation of the source schema. | |
// Generated on: 2013.06.24 at 02:12:54 AM CEST | |
// | |
package org.eclipse.om2m.commons.resource; | |
import java.util.ArrayList; | |
import java.util.List; | |
import javax.persistence.ElementCollection; | |
import javax.persistence.Entity; | |
import javax.persistence.GeneratedValue; | |
import javax.persistence.GenerationType; | |
import javax.persistence.Id; | |
import javax.xml.bind.annotation.XmlAccessType; | |
import javax.xml.bind.annotation.XmlAccessorType; | |
import javax.xml.bind.annotation.XmlTransient; | |
import javax.xml.bind.annotation.XmlType; | |
/** | |
* <p>Java Class for PermissionListType complex type. | |
* | |
* <p>The following schema fragment specifies the expected content contained within this class. | |
* | |
* <pre> | |
* <complexType name="PermissionListType"> | |
* <complexContent> | |
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> | |
* <sequence> | |
* <element ref="{http://uri.etsi.org/m2m}permission" maxOccurs="unbounded" minOccurs="0"/> | |
* </sequence> | |
* </restriction> | |
* </complexContent> | |
* </complexType> | |
* </pre> | |
* | |
* | |
*/ | |
@XmlAccessorType(XmlAccessType.FIELD) | |
@XmlType(name = "PermissionListType", propOrder = { | |
"permission" | |
}) | |
@Entity(name=DBEntities.PERMISSION_LIST_TYPE_ENTITY) | |
public class PermissionListType { | |
@Id | |
@GeneratedValue(strategy=GenerationType.AUTO) | |
@XmlTransient | |
private String id; | |
@ElementCollection | |
protected List<PermissionType> permission; | |
/** | |
* Gets the value of the permission property. | |
* | |
* <p> | |
* This accessor method returns a reference to the live list, | |
* not a snapshot. Therefore any modification you make to the | |
* returned list will be present inside the JAXB object. | |
* This is why there is not a <CODE>set</CODE> method for the permission property. | |
* | |
* <p> | |
* For example, to add a new item, do as follows: | |
* <pre> | |
* getPermission().add(newItem); | |
* </pre> | |
* | |
* | |
* <p> | |
* Objects of the following type(s) are allowed in the list | |
* {@link PermissionType } | |
* | |
* | |
*/ | |
public List<PermissionType> getPermission() { | |
if (permission == null) { | |
permission = new ArrayList<PermissionType>(); | |
} | |
return this.permission; | |
} | |
@Override | |
public int hashCode() { | |
final int prime = 31; | |
int result = 1; | |
result = prime * result + ((id == null) ? 0 : id.hashCode()); | |
result = prime * result | |
+ ((permission == null) ? 0 : permission.hashCode()); | |
return result; | |
} | |
@Override | |
public boolean equals(Object obj) { | |
if (this == obj) { | |
return true; | |
} | |
if (obj == null) { | |
return false; | |
} | |
if (getClass() != obj.getClass()) { | |
return false; | |
} | |
PermissionListType other = (PermissionListType) obj; | |
if (id == null) { | |
if (other.id != null) { | |
return false; | |
} | |
} else if (!id.equals(other.id)) { | |
return false; | |
} | |
if (permission == null) { | |
if (other.permission != null) { | |
return false; | |
} | |
} else if (!permission.equals(other.permission)) { | |
return false; | |
} | |
return true; | |
} | |
} |