/* * Copyright (C) 2013 Jan Pokorsky * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package cz.cas.lib.proarc.oaidublincore; import static cz.cas.lib.proarc.oaidublincore.DcConstants.*; import javax.xml.XMLConstants; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlValue; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; /** * <p>Java class for elementType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * <complexType name="elementType"> * <simpleContent> * <extension base="<http://www.w3.org/2001/XMLSchema>string"> * <attribute ref="{http://www.w3.org/XML/1998/namespace}lang"/> * </extension> * </simpleContent> * </complexType> * </pre> * * @author Jan Pokorsky */ @XmlAccessorType(value = XmlAccessType.FIELD) @XmlType(name = "elementType", namespace = NS_PURL) public class ElementType { @XmlValue private String value; @XmlAttribute(name = "lang", namespace = XMLConstants.XML_NS_URI, required = false) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "language") private String lang; public ElementType() { } public ElementType(String value, String lang) { this.value = value; this.lang = lang; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } public String getLang() { return lang; } public void setLang(String lang) { this.lang = lang; } @Override public String toString() { return "ElementType{" + "value=" + value + ", lang=" + lang + '}'; } @Override public int hashCode() { int hash = 3; hash = 97 * hash + (this.value != null ? this.value.hashCode() : 0); hash = 97 * hash + (this.lang != null ? this.lang.hashCode() : 0); return hash; } @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final ElementType other = (ElementType) obj; if ((this.value == null) ? (other.value != null) : !this.value.equals(other.value)) { return false; } if ((this.lang == null) ? (other.lang != null) : !this.lang.equals(other.lang)) { return false; } return true; } }