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

org.mitre.cybox.objects.NetworkRouteObject 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.06.23 at 10:59:44 AM EDT 
//

package org.mitre.cybox.objects;

import java.io.StringReader;
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.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.namespace.QName;
import javax.xml.transform.stream.StreamSource;
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.cybox.common_2.CustomPropertiesType;
import org.mitre.cybox.common_2.DurationObjectPropertyType;
import org.mitre.cybox.common_2.ObjectPropertiesType;
import org.mitre.cybox.common_2.StructuredTextType;
import org.mitre.stix.DocumentUtilities;
import org.mitre.stix.STIXSchema;
import org.mitre.stix.ValidationEventHandler;

/**
 * The NetRouteObjectType type is intended to characterize a specific network route.
 * 
 * 

Java class for NetRouteObjectType complex type. * *

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

 * <complexType name="NetRouteObjectType">
 *   <complexContent>
 *     <extension base="{http://cybox.mitre.org/common-2}ObjectPropertiesType">
 *       <sequence>
 *         <element name="Description" type="{http://cybox.mitre.org/common-2}StructuredTextType" minOccurs="0"/>
 *         <element name="Network_Route_Entries" type="{http://cybox.mitre.org/objects#NetworkRouteObject-2}NetworkRouteEntriesType" minOccurs="0"/>
 *         <element name="Preferred_Lifetime" type="{http://cybox.mitre.org/common-2}DurationObjectPropertyType" minOccurs="0"/>
 *         <element name="Valid_Lifetime" type="{http://cybox.mitre.org/common-2}DurationObjectPropertyType" minOccurs="0"/>
 *         <element name="Route_Age" type="{http://cybox.mitre.org/common-2}DurationObjectPropertyType" minOccurs="0"/>
 *       </sequence>
 *       <attribute name="is_ipv6" type="{http://www.w3.org/2001/XMLSchema}boolean" />
 *       <attribute name="is_autoconfigure_address" type="{http://www.w3.org/2001/XMLSchema}boolean" />
 *       <attribute name="is_immortal" type="{http://www.w3.org/2001/XMLSchema}boolean" />
 *       <attribute name="is_loopback" type="{http://www.w3.org/2001/XMLSchema}boolean" />
 *       <attribute name="is_publish" type="{http://www.w3.org/2001/XMLSchema}boolean" />
 *     </extension>
 *   </complexContent>
 * </complexType>
 * 
* * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "NetRouteObjectType", namespace = "http://cybox.mitre.org/objects#NetworkRouteObject-2", propOrder = { "description", "networkRouteEntries", "preferredLifetime", "validLifetime", "routeAge" }) @XmlRootElement(name = "Network_Route_Object", namespace = "http://cybox.mitre.org/objects#NetworkRouteObject-2") public class NetworkRouteObject extends ObjectPropertiesType implements Equals, HashCode, ToString { @XmlElement(name = "Description") protected StructuredTextType description; @XmlElement(name = "Network_Route_Entries") protected NetworkRouteEntriesType networkRouteEntries; @XmlElement(name = "Preferred_Lifetime") protected DurationObjectPropertyType preferredLifetime; @XmlElement(name = "Valid_Lifetime") protected DurationObjectPropertyType validLifetime; @XmlElement(name = "Route_Age") protected DurationObjectPropertyType routeAge; @XmlAttribute(name = "is_ipv6") protected Boolean isIpv6; @XmlAttribute(name = "is_autoconfigure_address") protected Boolean isAutoconfigureAddress; @XmlAttribute(name = "is_immortal") protected Boolean isImmortal; @XmlAttribute(name = "is_loopback") protected Boolean isLoopback; @XmlAttribute(name = "is_publish") protected Boolean isPublish; /** * Default no-arg constructor * */ public NetworkRouteObject() { super(); } /** * Fully-initialising value constructor * */ public NetworkRouteObject(final CustomPropertiesType customProperties, final QName objectReference, final StructuredTextType description, final NetworkRouteEntriesType networkRouteEntries, final DurationObjectPropertyType preferredLifetime, final DurationObjectPropertyType validLifetime, final DurationObjectPropertyType routeAge, final Boolean isIpv6, final Boolean isAutoconfigureAddress, final Boolean isImmortal, final Boolean isLoopback, final Boolean isPublish) { super(customProperties, objectReference); this.description = description; this.networkRouteEntries = networkRouteEntries; this.preferredLifetime = preferredLifetime; this.validLifetime = validLifetime; this.routeAge = routeAge; this.isIpv6 = isIpv6; this.isAutoconfigureAddress = isAutoconfigureAddress; this.isImmortal = isImmortal; this.isLoopback = isLoopback; this.isPublish = isPublish; } /** * Gets the value of the description property. * * @return * possible object is * {@link StructuredTextType } * */ public StructuredTextType getDescription() { return description; } /** * Sets the value of the description property. * * @param value * allowed object is * {@link StructuredTextType } * */ public void setDescription(StructuredTextType value) { this.description = value; } /** * Gets the value of the networkRouteEntries property. * * @return * possible object is * {@link NetworkRouteEntriesType } * */ public NetworkRouteEntriesType getNetworkRouteEntries() { return networkRouteEntries; } /** * Sets the value of the networkRouteEntries property. * * @param value * allowed object is * {@link NetworkRouteEntriesType } * */ public void setNetworkRouteEntries(NetworkRouteEntriesType value) { this.networkRouteEntries = value; } /** * Gets the value of the preferredLifetime property. * * @return * possible object is * {@link DurationObjectPropertyType } * */ public DurationObjectPropertyType getPreferredLifetime() { return preferredLifetime; } /** * Sets the value of the preferredLifetime property. * * @param value * allowed object is * {@link DurationObjectPropertyType } * */ public void setPreferredLifetime(DurationObjectPropertyType value) { this.preferredLifetime = value; } /** * Gets the value of the validLifetime property. * * @return * possible object is * {@link DurationObjectPropertyType } * */ public DurationObjectPropertyType getValidLifetime() { return validLifetime; } /** * Sets the value of the validLifetime property. * * @param value * allowed object is * {@link DurationObjectPropertyType } * */ public void setValidLifetime(DurationObjectPropertyType value) { this.validLifetime = value; } /** * Gets the value of the routeAge property. * * @return * possible object is * {@link DurationObjectPropertyType } * */ public DurationObjectPropertyType getRouteAge() { return routeAge; } /** * Sets the value of the routeAge property. * * @param value * allowed object is * {@link DurationObjectPropertyType } * */ public void setRouteAge(DurationObjectPropertyType value) { this.routeAge = value; } /** * Gets the value of the isIpv6 property. * * @return * possible object is * {@link Boolean } * */ public Boolean isIsIpv6() { return isIpv6; } /** * Sets the value of the isIpv6 property. * * @param value * allowed object is * {@link Boolean } * */ public void setIsIpv6(Boolean value) { this.isIpv6 = value; } /** * Gets the value of the isAutoconfigureAddress property. * * @return * possible object is * {@link Boolean } * */ public Boolean isIsAutoconfigureAddress() { return isAutoconfigureAddress; } /** * Sets the value of the isAutoconfigureAddress property. * * @param value * allowed object is * {@link Boolean } * */ public void setIsAutoconfigureAddress(Boolean value) { this.isAutoconfigureAddress = value; } /** * Gets the value of the isImmortal property. * * @return * possible object is * {@link Boolean } * */ public Boolean isIsImmortal() { return isImmortal; } /** * Sets the value of the isImmortal property. * * @param value * allowed object is * {@link Boolean } * */ public void setIsImmortal(Boolean value) { this.isImmortal = value; } /** * Gets the value of the isLoopback property. * * @return * possible object is * {@link Boolean } * */ public Boolean isIsLoopback() { return isLoopback; } /** * Sets the value of the isLoopback property. * * @param value * allowed object is * {@link Boolean } * */ public void setIsLoopback(Boolean value) { this.isLoopback = value; } /** * Gets the value of the isPublish property. * * @return * possible object is * {@link Boolean } * */ public Boolean isIsPublish() { return isPublish; } /** * Sets the value of the isPublish property. * * @param value * allowed object is * {@link Boolean } * */ public void setIsPublish(Boolean value) { this.isPublish = value; } public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { if (!(object instanceof NetworkRouteObject)) { return false; } if (this == object) { return true; } if (!super.equals(thisLocator, thatLocator, object, strategy)) { return false; } final NetworkRouteObject that = ((NetworkRouteObject) object); { StructuredTextType lhsDescription; lhsDescription = this.getDescription(); StructuredTextType rhsDescription; rhsDescription = that.getDescription(); if (!strategy.equals(LocatorUtils.property(thisLocator, "description", lhsDescription), LocatorUtils.property( thatLocator, "description", rhsDescription), lhsDescription, rhsDescription)) { return false; } } { NetworkRouteEntriesType lhsNetworkRouteEntries; lhsNetworkRouteEntries = this.getNetworkRouteEntries(); NetworkRouteEntriesType rhsNetworkRouteEntries; rhsNetworkRouteEntries = that.getNetworkRouteEntries(); if (!strategy.equals(LocatorUtils.property(thisLocator, "networkRouteEntries", lhsNetworkRouteEntries), LocatorUtils.property(thatLocator, "networkRouteEntries", rhsNetworkRouteEntries), lhsNetworkRouteEntries, rhsNetworkRouteEntries)) { return false; } } { DurationObjectPropertyType lhsPreferredLifetime; lhsPreferredLifetime = this.getPreferredLifetime(); DurationObjectPropertyType rhsPreferredLifetime; rhsPreferredLifetime = that.getPreferredLifetime(); if (!strategy.equals(LocatorUtils.property(thisLocator, "preferredLifetime", lhsPreferredLifetime), LocatorUtils .property(thatLocator, "preferredLifetime", rhsPreferredLifetime), lhsPreferredLifetime, rhsPreferredLifetime)) { return false; } } { DurationObjectPropertyType lhsValidLifetime; lhsValidLifetime = this.getValidLifetime(); DurationObjectPropertyType rhsValidLifetime; rhsValidLifetime = that.getValidLifetime(); if (!strategy.equals(LocatorUtils.property(thisLocator, "validLifetime", lhsValidLifetime), LocatorUtils.property( thatLocator, "validLifetime", rhsValidLifetime), lhsValidLifetime, rhsValidLifetime)) { return false; } } { DurationObjectPropertyType lhsRouteAge; lhsRouteAge = this.getRouteAge(); DurationObjectPropertyType rhsRouteAge; rhsRouteAge = that.getRouteAge(); if (!strategy .equals(LocatorUtils.property(thisLocator, "routeAge", lhsRouteAge), LocatorUtils.property(thatLocator, "routeAge", rhsRouteAge), lhsRouteAge, rhsRouteAge)) { return false; } } { Boolean lhsIsIpv6; lhsIsIpv6 = this.isIsIpv6(); Boolean rhsIsIpv6; rhsIsIpv6 = that.isIsIpv6(); if (!strategy.equals( LocatorUtils.property(thisLocator, "isIpv6", lhsIsIpv6), LocatorUtils.property(thatLocator, "isIpv6", rhsIsIpv6), lhsIsIpv6, rhsIsIpv6)) { return false; } } { Boolean lhsIsAutoconfigureAddress; lhsIsAutoconfigureAddress = this.isIsAutoconfigureAddress(); Boolean rhsIsAutoconfigureAddress; rhsIsAutoconfigureAddress = that.isIsAutoconfigureAddress(); if (!strategy.equals(LocatorUtils.property(thisLocator, "isAutoconfigureAddress", lhsIsAutoconfigureAddress), LocatorUtils .property(thatLocator, "isAutoconfigureAddress", rhsIsAutoconfigureAddress), lhsIsAutoconfigureAddress, rhsIsAutoconfigureAddress)) { return false; } } { Boolean lhsIsImmortal; lhsIsImmortal = this.isIsImmortal(); Boolean rhsIsImmortal; rhsIsImmortal = that.isIsImmortal(); if (!strategy.equals(LocatorUtils.property(thisLocator, "isImmortal", lhsIsImmortal), LocatorUtils.property( thatLocator, "isImmortal", rhsIsImmortal), lhsIsImmortal, rhsIsImmortal)) { return false; } } { Boolean lhsIsLoopback; lhsIsLoopback = this.isIsLoopback(); Boolean rhsIsLoopback; rhsIsLoopback = that.isIsLoopback(); if (!strategy.equals(LocatorUtils.property(thisLocator, "isLoopback", lhsIsLoopback), LocatorUtils.property( thatLocator, "isLoopback", rhsIsLoopback), lhsIsLoopback, rhsIsLoopback)) { return false; } } { Boolean lhsIsPublish; lhsIsPublish = this.isIsPublish(); Boolean rhsIsPublish; rhsIsPublish = that.isIsPublish(); if (!strategy.equals(LocatorUtils.property(thisLocator, "isPublish", lhsIsPublish), LocatorUtils.property( thatLocator, "isPublish", rhsIsPublish), lhsIsPublish, rhsIsPublish)) { 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 = super.hashCode(locator, strategy); { StructuredTextType theDescription; theDescription = this.getDescription(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "description", theDescription), currentHashCode, theDescription); } { NetworkRouteEntriesType theNetworkRouteEntries; theNetworkRouteEntries = this.getNetworkRouteEntries(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "networkRouteEntries", theNetworkRouteEntries), currentHashCode, theNetworkRouteEntries); } { DurationObjectPropertyType thePreferredLifetime; thePreferredLifetime = this.getPreferredLifetime(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "preferredLifetime", thePreferredLifetime), currentHashCode, thePreferredLifetime); } { DurationObjectPropertyType theValidLifetime; theValidLifetime = this.getValidLifetime(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "validLifetime", theValidLifetime), currentHashCode, theValidLifetime); } { DurationObjectPropertyType theRouteAge; theRouteAge = this.getRouteAge(); currentHashCode = strategy.hashCode( LocatorUtils.property(locator, "routeAge", theRouteAge), currentHashCode, theRouteAge); } { Boolean theIsIpv6; theIsIpv6 = this.isIsIpv6(); currentHashCode = strategy.hashCode( LocatorUtils.property(locator, "isIpv6", theIsIpv6), currentHashCode, theIsIpv6); } { Boolean theIsAutoconfigureAddress; theIsAutoconfigureAddress = this.isIsAutoconfigureAddress(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isAutoconfigureAddress", theIsAutoconfigureAddress), currentHashCode, theIsAutoconfigureAddress); } { Boolean theIsImmortal; theIsImmortal = this.isIsImmortal(); currentHashCode = strategy .hashCode(LocatorUtils.property(locator, "isImmortal", theIsImmortal), currentHashCode, theIsImmortal); } { Boolean theIsLoopback; theIsLoopback = this.isIsLoopback(); currentHashCode = strategy .hashCode(LocatorUtils.property(locator, "isLoopback", theIsLoopback), currentHashCode, theIsLoopback); } { Boolean theIsPublish; theIsPublish = this.isIsPublish(); currentHashCode = strategy.hashCode( LocatorUtils.property(locator, "isPublish", theIsPublish), currentHashCode, theIsPublish); } return currentHashCode; } public int hashCode() { final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; return this.hashCode(null, strategy); } public NetworkRouteObject withDescription(StructuredTextType value) { setDescription(value); return this; } public NetworkRouteObject withNetworkRouteEntries( NetworkRouteEntriesType value) { setNetworkRouteEntries(value); return this; } public NetworkRouteObject withPreferredLifetime( DurationObjectPropertyType value) { setPreferredLifetime(value); return this; } public NetworkRouteObject withValidLifetime(DurationObjectPropertyType value) { setValidLifetime(value); return this; } public NetworkRouteObject withRouteAge(DurationObjectPropertyType value) { setRouteAge(value); return this; } public NetworkRouteObject withIsIpv6(Boolean value) { setIsIpv6(value); return this; } public NetworkRouteObject withIsAutoconfigureAddress(Boolean value) { setIsAutoconfigureAddress(value); return this; } public NetworkRouteObject withIsImmortal(Boolean value) { setIsImmortal(value); return this; } public NetworkRouteObject withIsLoopback(Boolean value) { setIsLoopback(value); return this; } public NetworkRouteObject withIsPublish(Boolean value) { setIsPublish(value); return this; } @Override public NetworkRouteObject withCustomProperties(CustomPropertiesType value) { setCustomProperties(value); return this; } @Override public NetworkRouteObject withObjectReference(QName value) { setObjectReference(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) { super.appendFields(locator, buffer, strategy); { StructuredTextType theDescription; theDescription = this.getDescription(); strategy.appendField(locator, this, "description", buffer, theDescription); } { NetworkRouteEntriesType theNetworkRouteEntries; theNetworkRouteEntries = this.getNetworkRouteEntries(); strategy.appendField(locator, this, "networkRouteEntries", buffer, theNetworkRouteEntries); } { DurationObjectPropertyType thePreferredLifetime; thePreferredLifetime = this.getPreferredLifetime(); strategy.appendField(locator, this, "preferredLifetime", buffer, thePreferredLifetime); } { DurationObjectPropertyType theValidLifetime; theValidLifetime = this.getValidLifetime(); strategy.appendField(locator, this, "validLifetime", buffer, theValidLifetime); } { DurationObjectPropertyType theRouteAge; theRouteAge = this.getRouteAge(); strategy.appendField(locator, this, "routeAge", buffer, theRouteAge); } { Boolean theIsIpv6; theIsIpv6 = this.isIsIpv6(); strategy.appendField(locator, this, "isIpv6", buffer, theIsIpv6); } { Boolean theIsAutoconfigureAddress; theIsAutoconfigureAddress = this.isIsAutoconfigureAddress(); strategy.appendField(locator, this, "isAutoconfigureAddress", buffer, theIsAutoconfigureAddress); } { Boolean theIsImmortal; theIsImmortal = this.isIsImmortal(); strategy.appendField(locator, this, "isImmortal", buffer, theIsImmortal); } { Boolean theIsLoopback; theIsLoopback = this.isIsLoopback(); strategy.appendField(locator, this, "isLoopback", buffer, theIsLoopback); } { Boolean theIsPublish; theIsPublish = this.isIsPublish(); strategy.appendField(locator, this, "isPublish", buffer, theIsPublish); } 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, NetworkRouteObject.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 NetworkRouteObject instance for XML String * * @param text * XML String for the document * @return The NetworkRouteObject instance for the passed XML String */ public static NetworkRouteObject fromXMLString(String text) { JAXBContext jaxbContext; try { jaxbContext = JAXBContext.newInstance(NetworkRouteObject.class .getPackage().getName()); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); unmarshaller.setSchema(STIXSchema.getInstance().getSchema()); unmarshaller.setEventHandler(new ValidationEventHandler()); StreamSource streamSource = new StreamSource(new StringReader(text)); return (NetworkRouteObject) unmarshaller.unmarshal(streamSource); } catch (JAXBException e) { throw new RuntimeException(e); } } /** * Validates the XML representation of this NetworkRouteObject instance * Returning true indicating a successful validation, false if not. * * @return boolean */ public boolean validate() { return STIXSchema.getInstance().validate(toXMLString()); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy