//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
// 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.09.27 at 12:06:26 PM CEST 
//

package com.ejie.notification.xml;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

/**
 * <p>
 * Java class for anonymous complex type.
 * 
 * <p>
 * The following schema fragment specifies the expected content contained within
 * this class.
 * 
 * <pre>
 * &lt;complexType>
 *   &lt;complexContent>
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       &lt;sequence>
 *         &lt;element ref="{com/ejie/notification/xml}Property" maxOccurs="unbounded"/>
 *         &lt;element name="xmlValue" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *       &lt;/sequence>
 *     &lt;/restriction>
 *   &lt;/complexContent>
 * &lt;/complexType>
 * </pre>
 * 
 * @author GFI-NORTE
 * 
 */
@XmlAccessorType(value = XmlAccessType.FIELD)
@XmlType(name = "", propOrder = { "property", "xmlValue" })
@XmlRootElement(name = "NotificationBody")
public class NotificationBody {

	@XmlElement(name = "Property", required = true)
	private List<Property> property;
	private String xmlValue;

	/**
	 * Gets the value of the property 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 property property.
	 * 
	 * <p>
	 * For example, to add a new item, do as follows:
	 * 
	 * <pre>
	 * getProperty().add(newItem);
	 * </pre>
	 * 
	 * 
	 * <p>
	 * Objects of the following type(s) are allowed in the list {@link Property }
	 * 
	 * @return List<Property>
	 */
	public List<Property> getProperty() {
		if (this.property == null) {
			this.property = new ArrayList<Property>();
		}
		return this.property;
	}

	/**
	 * Gets the value of the xmlValue property.
	 * 
	 * @return possible object is {@link String }
	 * 
	 */
	public String getXmlValue() {
		return this.xmlValue;
	}

	/**
	 * Sets the value of the xmlValue property.
	 * 
	 * @param value
	 *            allowed object is {@link String }
	 * 
	 */
	public void setXmlValue(String value) {
		this.xmlValue = value;
	}

	/**
	 * Dado un nombre de una propiedad, devuelve su valor. Si no existe devuelve
	 * null
	 * 
	 * @param name
	 *            nombre de la propiedad cuyo valor se quiere obtener
	 * @return String
	 */
	public String getPropertyValue(String name) {
		String valor = null;

		if (this.property != null && !this.property.isEmpty()) {
			for (Property prop : this.property) {
				if (name.equals(prop.getName())) {
					valor = prop.getValue();
					break;
				}
			}
		}

		return valor;
	}

}
