All Downloads are FREE. Search and download functionalities are using the official Maven repository.

oasis.names.tc.ciq.xpil._3.PersonInfo Maven / Gradle / Ivy

There is a newer version: 1.2.0.2
Show newest version
/**
 * Copyright (c) 2015, The MITRE Corporation. All rights reserved.
 * See LICENSE for complete terms.
 */

//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.5-2 
// See http://java.sun.com/xml/jaxb 
// Any modifications to this file will be lost upon recompilation of the source schema. 
// Generated on: 2015.07.01 at 03:30:29 PM EDT 
//

package oasis.names.tc.ciq.xpil._3;

import java.io.StringReader;
import java.util.HashMap;
import java.util.Map;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyAttribute;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.NormalizedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.namespace.QName;
import javax.xml.transform.stream.StreamSource;
import oasis.names.tc.ciq.ct._3.DataQualityTypeList;
import org.jvnet.jaxb2_commons.lang.Equals;
import org.jvnet.jaxb2_commons.lang.EqualsStrategy;
import org.jvnet.jaxb2_commons.lang.HashCode;
import org.jvnet.jaxb2_commons.lang.HashCodeStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
import org.jvnet.jaxb2_commons.lang.ToString;
import org.jvnet.jaxb2_commons.lang.ToStringStrategy;
import org.jvnet.jaxb2_commons.locator.ObjectLocator;
import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;
import org.mitre.stix.DocumentUtilities;
import org.mitre.stix.STIXSchema;
import org.mitre.stix.ValidationEventHandler;
import org.xml.sax.SAXException;

/**
 * 

Java class for anonymous complex type. * *

The following schema fragment specifies the expected content contained within this class. * *

 * <complexType>
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <attGroup ref="{urn:oasis:names:tc:ciq:ct:3}grDataQuality"/>
 *       <attribute name="Age" type="{urn:oasis:names:tc:ciq:ct:3}String" />
 *       <attribute name="CategoryType" type="{urn:oasis:names:tc:ciq:xpil:3}PersonCategoryTypeList" />
 *       <attribute name="PhysicalStatus" type="{urn:oasis:names:tc:ciq:xpil:3}PhysicalStatusList" />
 *       <attribute name="MaritalStatus" type="{urn:oasis:names:tc:ciq:xpil:3}MaritalStatusList" />
 *       <attribute name="Ethnicity" type="{urn:oasis:names:tc:ciq:xpil:3}PersonEthnicityList" />
 *       <attribute name="Gender" type="{urn:oasis:names:tc:ciq:xpil:3}GenderList" />
 *       <attribute name="Religion" type="{urn:oasis:names:tc:ciq:xpil:3}ReligionList" />
 *       <anyAttribute processContents='lax' namespace='##other'/>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 * 
* * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") @XmlRootElement(name = "PersonInfo") public class PersonInfo implements Equals, HashCode, ToString { @XmlAttribute(name = "Age", namespace = "urn:oasis:names:tc:ciq:xpil:3") @XmlJavaTypeAdapter(NormalizedStringAdapter.class) protected String age; @XmlAttribute(name = "CategoryType", namespace = "urn:oasis:names:tc:ciq:xpil:3") protected PersonCategoryTypeList categoryType; @XmlAttribute(name = "PhysicalStatus", namespace = "urn:oasis:names:tc:ciq:xpil:3") @XmlJavaTypeAdapter(NormalizedStringAdapter.class) protected String physicalStatus; @XmlAttribute(name = "MaritalStatus", namespace = "urn:oasis:names:tc:ciq:xpil:3") @XmlJavaTypeAdapter(NormalizedStringAdapter.class) protected String maritalStatus; @XmlAttribute(name = "Ethnicity", namespace = "urn:oasis:names:tc:ciq:xpil:3") @XmlJavaTypeAdapter(NormalizedStringAdapter.class) protected String ethnicity; @XmlAttribute(name = "Gender", namespace = "urn:oasis:names:tc:ciq:xpil:3") @XmlJavaTypeAdapter(NormalizedStringAdapter.class) protected String gender; @XmlAttribute(name = "Religion", namespace = "urn:oasis:names:tc:ciq:xpil:3") @XmlJavaTypeAdapter(NormalizedStringAdapter.class) protected String religion; @XmlAttribute(name = "DataQualityType", namespace = "urn:oasis:names:tc:ciq:ct:3") protected DataQualityTypeList dataQualityType; @XmlAttribute(name = "ValidFrom", namespace = "urn:oasis:names:tc:ciq:ct:3") @XmlSchemaType(name = "dateTime") protected XMLGregorianCalendar validFrom; @XmlAttribute(name = "ValidTo", namespace = "urn:oasis:names:tc:ciq:ct:3") @XmlSchemaType(name = "dateTime") protected XMLGregorianCalendar validTo; @XmlAnyAttribute private Map otherAttributes = new HashMap(); /** * Default no-arg constructor * */ public PersonInfo() { super(); } /** * Fully-initialising value constructor * */ public PersonInfo(final String age, final PersonCategoryTypeList categoryType, final String physicalStatus, final String maritalStatus, final String ethnicity, final String gender, final String religion, final DataQualityTypeList dataQualityType, final XMLGregorianCalendar validFrom, final XMLGregorianCalendar validTo, final Map otherAttributes) { this.age = age; this.categoryType = categoryType; this.physicalStatus = physicalStatus; this.maritalStatus = maritalStatus; this.ethnicity = ethnicity; this.gender = gender; this.religion = religion; this.dataQualityType = dataQualityType; this.validFrom = validFrom; this.validTo = validTo; this.otherAttributes = otherAttributes; } /** * Gets the value of the age property. * * @return * possible object is * {@link String } * */ public String getAge() { return age; } /** * Sets the value of the age property. * * @param value * allowed object is * {@link String } * */ public void setAge(String value) { this.age = value; } /** * Gets the value of the categoryType property. * * @return * possible object is * {@link PersonCategoryTypeList } * */ public PersonCategoryTypeList getCategoryType() { return categoryType; } /** * Sets the value of the categoryType property. * * @param value * allowed object is * {@link PersonCategoryTypeList } * */ public void setCategoryType(PersonCategoryTypeList value) { this.categoryType = value; } /** * Gets the value of the physicalStatus property. * * @return * possible object is * {@link String } * */ public String getPhysicalStatus() { return physicalStatus; } /** * Sets the value of the physicalStatus property. * * @param value * allowed object is * {@link String } * */ public void setPhysicalStatus(String value) { this.physicalStatus = value; } /** * Gets the value of the maritalStatus property. * * @return * possible object is * {@link String } * */ public String getMaritalStatus() { return maritalStatus; } /** * Sets the value of the maritalStatus property. * * @param value * allowed object is * {@link String } * */ public void setMaritalStatus(String value) { this.maritalStatus = value; } /** * Gets the value of the ethnicity property. * * @return * possible object is * {@link String } * */ public String getEthnicity() { return ethnicity; } /** * Sets the value of the ethnicity property. * * @param value * allowed object is * {@link String } * */ public void setEthnicity(String value) { this.ethnicity = value; } /** * Gets the value of the gender property. * * @return * possible object is * {@link String } * */ public String getGender() { return gender; } /** * Sets the value of the gender property. * * @param value * allowed object is * {@link String } * */ public void setGender(String value) { this.gender = value; } /** * Gets the value of the religion property. * * @return * possible object is * {@link String } * */ public String getReligion() { return religion; } /** * Sets the value of the religion property. * * @param value * allowed object is * {@link String } * */ public void setReligion(String value) { this.religion = value; } /** * Gets the value of the dataQualityType property. * * @return * possible object is * {@link DataQualityTypeList } * */ public DataQualityTypeList getDataQualityType() { return dataQualityType; } /** * Sets the value of the dataQualityType property. * * @param value * allowed object is * {@link DataQualityTypeList } * */ public void setDataQualityType(DataQualityTypeList value) { this.dataQualityType = value; } /** * Gets the value of the validFrom property. * * @return * possible object is * {@link XMLGregorianCalendar } * */ public XMLGregorianCalendar getValidFrom() { return validFrom; } /** * Sets the value of the validFrom property. * * @param value * allowed object is * {@link XMLGregorianCalendar } * */ public void setValidFrom(XMLGregorianCalendar value) { this.validFrom = value; } /** * Gets the value of the validTo property. * * @return * possible object is * {@link XMLGregorianCalendar } * */ public XMLGregorianCalendar getValidTo() { return validTo; } /** * Sets the value of the validTo property. * * @param value * allowed object is * {@link XMLGregorianCalendar } * */ public void setValidTo(XMLGregorianCalendar value) { this.validTo = value; } /** * Gets a map that contains attributes that aren't bound to any typed property on this class. * *

* the map is keyed by the name of the attribute and * the value is the string value of the attribute. * * the map returned by this method is live, and you can add new attribute * by updating the map directly. Because of this design, there's no setter. * * * @return * always non-null */ public Map getOtherAttributes() { return otherAttributes; } public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { if (!(object instanceof PersonInfo)) { return false; } if (this == object) { return true; } final PersonInfo that = ((PersonInfo) object); { String lhsAge; lhsAge = this.getAge(); String rhsAge; rhsAge = that.getAge(); if (!strategy.equals( LocatorUtils.property(thisLocator, "age", lhsAge), LocatorUtils.property(thatLocator, "age", rhsAge), lhsAge, rhsAge)) { return false; } } { PersonCategoryTypeList lhsCategoryType; lhsCategoryType = this.getCategoryType(); PersonCategoryTypeList rhsCategoryType; rhsCategoryType = that.getCategoryType(); if (!strategy.equals(LocatorUtils.property(thisLocator, "categoryType", lhsCategoryType), LocatorUtils.property( thatLocator, "categoryType", rhsCategoryType), lhsCategoryType, rhsCategoryType)) { return false; } } { String lhsPhysicalStatus; lhsPhysicalStatus = this.getPhysicalStatus(); String rhsPhysicalStatus; rhsPhysicalStatus = that.getPhysicalStatus(); if (!strategy.equals(LocatorUtils.property(thisLocator, "physicalStatus", lhsPhysicalStatus), LocatorUtils.property(thatLocator, "physicalStatus", rhsPhysicalStatus), lhsPhysicalStatus, rhsPhysicalStatus)) { return false; } } { String lhsMaritalStatus; lhsMaritalStatus = this.getMaritalStatus(); String rhsMaritalStatus; rhsMaritalStatus = that.getMaritalStatus(); if (!strategy.equals(LocatorUtils.property(thisLocator, "maritalStatus", lhsMaritalStatus), LocatorUtils.property( thatLocator, "maritalStatus", rhsMaritalStatus), lhsMaritalStatus, rhsMaritalStatus)) { return false; } } { String lhsEthnicity; lhsEthnicity = this.getEthnicity(); String rhsEthnicity; rhsEthnicity = that.getEthnicity(); if (!strategy.equals(LocatorUtils.property(thisLocator, "ethnicity", lhsEthnicity), LocatorUtils.property( thatLocator, "ethnicity", rhsEthnicity), lhsEthnicity, rhsEthnicity)) { return false; } } { String lhsGender; lhsGender = this.getGender(); String rhsGender; rhsGender = that.getGender(); if (!strategy.equals( LocatorUtils.property(thisLocator, "gender", lhsGender), LocatorUtils.property(thatLocator, "gender", rhsGender), lhsGender, rhsGender)) { return false; } } { String lhsReligion; lhsReligion = this.getReligion(); String rhsReligion; rhsReligion = that.getReligion(); if (!strategy .equals(LocatorUtils.property(thisLocator, "religion", lhsReligion), LocatorUtils.property(thatLocator, "religion", rhsReligion), lhsReligion, rhsReligion)) { return false; } } { DataQualityTypeList lhsDataQualityType; lhsDataQualityType = this.getDataQualityType(); DataQualityTypeList rhsDataQualityType; rhsDataQualityType = that.getDataQualityType(); if (!strategy.equals(LocatorUtils.property(thisLocator, "dataQualityType", lhsDataQualityType), LocatorUtils .property(thatLocator, "dataQualityType", rhsDataQualityType), lhsDataQualityType, rhsDataQualityType)) { return false; } } { XMLGregorianCalendar lhsValidFrom; lhsValidFrom = this.getValidFrom(); XMLGregorianCalendar rhsValidFrom; rhsValidFrom = that.getValidFrom(); if (!strategy.equals(LocatorUtils.property(thisLocator, "validFrom", lhsValidFrom), LocatorUtils.property( thatLocator, "validFrom", rhsValidFrom), lhsValidFrom, rhsValidFrom)) { return false; } } { XMLGregorianCalendar lhsValidTo; lhsValidTo = this.getValidTo(); XMLGregorianCalendar rhsValidTo; rhsValidTo = that.getValidTo(); if (!strategy.equals( LocatorUtils.property(thisLocator, "validTo", lhsValidTo), LocatorUtils.property(thatLocator, "validTo", rhsValidTo), lhsValidTo, rhsValidTo)) { return false; } } return true; } public boolean equals(Object object) { final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); } public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = 1; { String theAge; theAge = this.getAge(); currentHashCode = strategy.hashCode( LocatorUtils.property(locator, "age", theAge), currentHashCode, theAge); } { PersonCategoryTypeList theCategoryType; theCategoryType = this.getCategoryType(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "categoryType", theCategoryType), currentHashCode, theCategoryType); } { String thePhysicalStatus; thePhysicalStatus = this.getPhysicalStatus(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "physicalStatus", thePhysicalStatus), currentHashCode, thePhysicalStatus); } { String theMaritalStatus; theMaritalStatus = this.getMaritalStatus(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "maritalStatus", theMaritalStatus), currentHashCode, theMaritalStatus); } { String theEthnicity; theEthnicity = this.getEthnicity(); currentHashCode = strategy.hashCode( LocatorUtils.property(locator, "ethnicity", theEthnicity), currentHashCode, theEthnicity); } { String theGender; theGender = this.getGender(); currentHashCode = strategy.hashCode( LocatorUtils.property(locator, "gender", theGender), currentHashCode, theGender); } { String theReligion; theReligion = this.getReligion(); currentHashCode = strategy.hashCode( LocatorUtils.property(locator, "religion", theReligion), currentHashCode, theReligion); } { DataQualityTypeList theDataQualityType; theDataQualityType = this.getDataQualityType(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "dataQualityType", theDataQualityType), currentHashCode, theDataQualityType); } { XMLGregorianCalendar theValidFrom; theValidFrom = this.getValidFrom(); currentHashCode = strategy.hashCode( LocatorUtils.property(locator, "validFrom", theValidFrom), currentHashCode, theValidFrom); } { XMLGregorianCalendar theValidTo; theValidTo = this.getValidTo(); currentHashCode = strategy.hashCode( LocatorUtils.property(locator, "validTo", theValidTo), currentHashCode, theValidTo); } return currentHashCode; } public int hashCode() { final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; return this.hashCode(null, strategy); } public PersonInfo withAge(String value) { setAge(value); return this; } public PersonInfo withCategoryType(PersonCategoryTypeList value) { setCategoryType(value); return this; } public PersonInfo withPhysicalStatus(String value) { setPhysicalStatus(value); return this; } public PersonInfo withMaritalStatus(String value) { setMaritalStatus(value); return this; } public PersonInfo withEthnicity(String value) { setEthnicity(value); return this; } public PersonInfo withGender(String value) { setGender(value); return this; } public PersonInfo withReligion(String value) { setReligion(value); return this; } public PersonInfo withDataQualityType(DataQualityTypeList value) { setDataQualityType(value); return this; } public PersonInfo withValidFrom(XMLGregorianCalendar value) { setValidFrom(value); return this; } public PersonInfo withValidTo(XMLGregorianCalendar value) { setValidTo(value); return this; } public String toString() { final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE; final StringBuilder buffer = new StringBuilder(); append(null, buffer, strategy); return buffer.toString(); } public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { strategy.appendStart(locator, this, buffer); appendFields(locator, buffer, strategy); strategy.appendEnd(locator, this, buffer); return buffer; } public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { { String theAge; theAge = this.getAge(); strategy.appendField(locator, this, "age", buffer, theAge); } { PersonCategoryTypeList theCategoryType; theCategoryType = this.getCategoryType(); strategy.appendField(locator, this, "categoryType", buffer, theCategoryType); } { String thePhysicalStatus; thePhysicalStatus = this.getPhysicalStatus(); strategy.appendField(locator, this, "physicalStatus", buffer, thePhysicalStatus); } { String theMaritalStatus; theMaritalStatus = this.getMaritalStatus(); strategy.appendField(locator, this, "maritalStatus", buffer, theMaritalStatus); } { String theEthnicity; theEthnicity = this.getEthnicity(); strategy.appendField(locator, this, "ethnicity", buffer, theEthnicity); } { String theGender; theGender = this.getGender(); strategy.appendField(locator, this, "gender", buffer, theGender); } { String theReligion; theReligion = this.getReligion(); strategy.appendField(locator, this, "religion", buffer, theReligion); } { DataQualityTypeList theDataQualityType; theDataQualityType = this.getDataQualityType(); strategy.appendField(locator, this, "dataQualityType", buffer, theDataQualityType); } { XMLGregorianCalendar theValidFrom; theValidFrom = this.getValidFrom(); strategy.appendField(locator, this, "validFrom", buffer, theValidFrom); } { XMLGregorianCalendar theValidTo; theValidTo = this.getValidTo(); strategy.appendField(locator, this, "validTo", buffer, theValidTo); } return buffer; } /** * Returns A Document representation of this instance that is not formatted. * * @return The Document representation for this instance. */ public org.w3c.dom.Document toDocument() { return toDocument(false); } /** * Returns A Document representation for this instance. * * @param prettyPrint * True for pretty print, otherwise false * * @return The Document representation for this instance. */ public org.w3c.dom.Document toDocument(boolean prettyPrint) { return DocumentUtilities.toDocument(toJAXBElement(), prettyPrint); } /** * Returns JAXBElement for this instance. * * @return The JAXBElement for this instance. */ @SuppressWarnings({ "rawtypes", "unchecked" }) public JAXBElement toJAXBElement() { QName qualifiedName = STIXSchema.getQualifiedName(this); return new JAXBElement(qualifiedName, PersonInfo.class, this); } /** * Returns String representation of this instance that is not formatted. * * @return The String containing the XML mark-up. */ public String toXMLString() { return toXMLString(false); } /** * Returns XML String for JAXB Document Object Model object. * * @param prettyPrint * True for pretty print, otherwise false * * @return The String containing the XML mark-up. */ public String toXMLString(boolean prettyPrint) { return DocumentUtilities.toXMLString(toDocument(), prettyPrint); } /** * Creates PersonInfo instance for XML String * * @param text * XML String for the document * @return The PersonInfo instance for the passed XML String */ public static PersonInfo fromXMLString(String text) { JAXBContext jaxbContext; try { jaxbContext = JAXBContext.newInstance(PersonInfo.class.getPackage() .getName()); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); unmarshaller.setSchema(STIXSchema.getInstance().getSchema()); unmarshaller.setEventHandler(new ValidationEventHandler()); StreamSource streamSource = new StreamSource(new StringReader(text)); return (PersonInfo) unmarshaller.unmarshal(streamSource); } catch (JAXBException e) { throw new RuntimeException(e); } } /** * Validates the XML representation of this PersonInfo instance * Returning true indicating a successful validation, false if not. * * @return boolean True If it validates against the schema * @throws SAXException * If the a validation ErrorHandler has not been set, and * validation throws a SAXException */ public boolean validate() throws SAXException { return STIXSchema.getInstance().validate(toXMLString()); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy