org.mitre.cybox.objects.WindowsPrefetchEntry Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of stix Show documentation
Show all versions of stix Show documentation
The Java bindings for STIX v.1.2.0.2
/**
* 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 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.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.DateTimeObjectPropertyType;
import org.mitre.cybox.common_2.LongObjectPropertyType;
import org.mitre.cybox.common_2.ObjectPropertiesType;
import org.mitre.cybox.common_2.StringObjectPropertyType;
import org.mitre.stix.DocumentUtilities;
import org.mitre.stix.STIXSchema;
import org.mitre.stix.ValidationEventHandler;
import org.xml.sax.SAXException;
/**
* The WindowsPrefetchObjectType type is intended to characterize entries in the Windows prefetch files. Starting with Windows XP, prefetching was introduced to speed up application startup. The prefetch object draws upon the descriptions and XML sample at http://www.forensicswiki.org/wiki/Prefetch_XML.
*
* Java class for WindowsPrefetchObjectType complex type.
*
*
The following schema fragment specifies the expected content contained within this class.
*
*
* <complexType name="WindowsPrefetchObjectType">
* <complexContent>
* <extension base="{http://cybox.mitre.org/common-2}ObjectPropertiesType">
* <sequence>
* <element name="Application_File_Name" type="{http://cybox.mitre.org/common-2}StringObjectPropertyType" minOccurs="0"/>
* <element name="Prefetch_Hash" type="{http://cybox.mitre.org/common-2}StringObjectPropertyType" minOccurs="0"/>
* <element name="Times_Executed" type="{http://cybox.mitre.org/common-2}LongObjectPropertyType" minOccurs="0"/>
* <element name="First_Run" type="{http://cybox.mitre.org/common-2}DateTimeObjectPropertyType" minOccurs="0"/>
* <element name="Last_Run" type="{http://cybox.mitre.org/common-2}DateTimeObjectPropertyType" minOccurs="0"/>
* <element name="Volume" type="{http://cybox.mitre.org/objects#WinPrefetchObject-2}VolumeType" minOccurs="0"/>
* <element name="Accessed_File_List" type="{http://cybox.mitre.org/objects#WinPrefetchObject-2}AccessedFileListType" minOccurs="0"/>
* <element name="Accessed_Directory_List" type="{http://cybox.mitre.org/objects#WinPrefetchObject-2}AccessedDirectoryListType" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "WindowsPrefetchObjectType", namespace = "http://cybox.mitre.org/objects#WinPrefetchObject-2", propOrder = {
"applicationFileName", "prefetchHash", "timesExecuted", "firstRun",
"lastRun", "volume", "accessedFileList", "accessedDirectoryList" })
@XmlRootElement(name = "Windows_Prefetch_Entry", namespace = "http://cybox.mitre.org/objects#WinPrefetchObject-2")
public class WindowsPrefetchEntry extends ObjectPropertiesType implements
Equals, HashCode, ToString {
@XmlElement(name = "Application_File_Name")
protected StringObjectPropertyType applicationFileName;
@XmlElement(name = "Prefetch_Hash")
protected StringObjectPropertyType prefetchHash;
@XmlElement(name = "Times_Executed")
protected LongObjectPropertyType timesExecuted;
@XmlElement(name = "First_Run")
protected DateTimeObjectPropertyType firstRun;
@XmlElement(name = "Last_Run")
protected DateTimeObjectPropertyType lastRun;
@XmlElement(name = "Volume")
protected VolumeType volume;
@XmlElement(name = "Accessed_File_List")
protected AccessedFileListType accessedFileList;
@XmlElement(name = "Accessed_Directory_List")
protected AccessedDirectoryListType accessedDirectoryList;
/**
* Default no-arg constructor
*
*/
public WindowsPrefetchEntry() {
super();
}
/**
* Fully-initialising value constructor
*
*/
public WindowsPrefetchEntry(final CustomPropertiesType customProperties,
final QName objectReference,
final StringObjectPropertyType applicationFileName,
final StringObjectPropertyType prefetchHash,
final LongObjectPropertyType timesExecuted,
final DateTimeObjectPropertyType firstRun,
final DateTimeObjectPropertyType lastRun, final VolumeType volume,
final AccessedFileListType accessedFileList,
final AccessedDirectoryListType accessedDirectoryList) {
super(customProperties, objectReference);
this.applicationFileName = applicationFileName;
this.prefetchHash = prefetchHash;
this.timesExecuted = timesExecuted;
this.firstRun = firstRun;
this.lastRun = lastRun;
this.volume = volume;
this.accessedFileList = accessedFileList;
this.accessedDirectoryList = accessedDirectoryList;
}
/**
* Gets the value of the applicationFileName property.
*
* @return
* possible object is
* {@link StringObjectPropertyType }
*
*/
public StringObjectPropertyType getApplicationFileName() {
return applicationFileName;
}
/**
* Sets the value of the applicationFileName property.
*
* @param value
* allowed object is
* {@link StringObjectPropertyType }
*
*/
public void setApplicationFileName(StringObjectPropertyType value) {
this.applicationFileName = value;
}
/**
* Gets the value of the prefetchHash property.
*
* @return
* possible object is
* {@link StringObjectPropertyType }
*
*/
public StringObjectPropertyType getPrefetchHash() {
return prefetchHash;
}
/**
* Sets the value of the prefetchHash property.
*
* @param value
* allowed object is
* {@link StringObjectPropertyType }
*
*/
public void setPrefetchHash(StringObjectPropertyType value) {
this.prefetchHash = value;
}
/**
* Gets the value of the timesExecuted property.
*
* @return
* possible object is
* {@link LongObjectPropertyType }
*
*/
public LongObjectPropertyType getTimesExecuted() {
return timesExecuted;
}
/**
* Sets the value of the timesExecuted property.
*
* @param value
* allowed object is
* {@link LongObjectPropertyType }
*
*/
public void setTimesExecuted(LongObjectPropertyType value) {
this.timesExecuted = value;
}
/**
* Gets the value of the firstRun property.
*
* @return
* possible object is
* {@link DateTimeObjectPropertyType }
*
*/
public DateTimeObjectPropertyType getFirstRun() {
return firstRun;
}
/**
* Sets the value of the firstRun property.
*
* @param value
* allowed object is
* {@link DateTimeObjectPropertyType }
*
*/
public void setFirstRun(DateTimeObjectPropertyType value) {
this.firstRun = value;
}
/**
* Gets the value of the lastRun property.
*
* @return
* possible object is
* {@link DateTimeObjectPropertyType }
*
*/
public DateTimeObjectPropertyType getLastRun() {
return lastRun;
}
/**
* Sets the value of the lastRun property.
*
* @param value
* allowed object is
* {@link DateTimeObjectPropertyType }
*
*/
public void setLastRun(DateTimeObjectPropertyType value) {
this.lastRun = value;
}
/**
* Gets the value of the volume property.
*
* @return
* possible object is
* {@link VolumeType }
*
*/
public VolumeType getVolume() {
return volume;
}
/**
* Sets the value of the volume property.
*
* @param value
* allowed object is
* {@link VolumeType }
*
*/
public void setVolume(VolumeType value) {
this.volume = value;
}
/**
* Gets the value of the accessedFileList property.
*
* @return
* possible object is
* {@link AccessedFileListType }
*
*/
public AccessedFileListType getAccessedFileList() {
return accessedFileList;
}
/**
* Sets the value of the accessedFileList property.
*
* @param value
* allowed object is
* {@link AccessedFileListType }
*
*/
public void setAccessedFileList(AccessedFileListType value) {
this.accessedFileList = value;
}
/**
* Gets the value of the accessedDirectoryList property.
*
* @return
* possible object is
* {@link AccessedDirectoryListType }
*
*/
public AccessedDirectoryListType getAccessedDirectoryList() {
return accessedDirectoryList;
}
/**
* Sets the value of the accessedDirectoryList property.
*
* @param value
* allowed object is
* {@link AccessedDirectoryListType }
*
*/
public void setAccessedDirectoryList(AccessedDirectoryListType value) {
this.accessedDirectoryList = value;
}
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator,
Object object, EqualsStrategy strategy) {
if (!(object instanceof WindowsPrefetchEntry)) {
return false;
}
if (this == object) {
return true;
}
if (!super.equals(thisLocator, thatLocator, object, strategy)) {
return false;
}
final WindowsPrefetchEntry that = ((WindowsPrefetchEntry) object);
{
StringObjectPropertyType lhsApplicationFileName;
lhsApplicationFileName = this.getApplicationFileName();
StringObjectPropertyType rhsApplicationFileName;
rhsApplicationFileName = that.getApplicationFileName();
if (!strategy.equals(LocatorUtils.property(thisLocator,
"applicationFileName", lhsApplicationFileName),
LocatorUtils.property(thatLocator, "applicationFileName",
rhsApplicationFileName), lhsApplicationFileName,
rhsApplicationFileName)) {
return false;
}
}
{
StringObjectPropertyType lhsPrefetchHash;
lhsPrefetchHash = this.getPrefetchHash();
StringObjectPropertyType rhsPrefetchHash;
rhsPrefetchHash = that.getPrefetchHash();
if (!strategy.equals(LocatorUtils.property(thisLocator,
"prefetchHash", lhsPrefetchHash), LocatorUtils.property(
thatLocator, "prefetchHash", rhsPrefetchHash),
lhsPrefetchHash, rhsPrefetchHash)) {
return false;
}
}
{
LongObjectPropertyType lhsTimesExecuted;
lhsTimesExecuted = this.getTimesExecuted();
LongObjectPropertyType rhsTimesExecuted;
rhsTimesExecuted = that.getTimesExecuted();
if (!strategy.equals(LocatorUtils.property(thisLocator,
"timesExecuted", lhsTimesExecuted), LocatorUtils.property(
thatLocator, "timesExecuted", rhsTimesExecuted),
lhsTimesExecuted, rhsTimesExecuted)) {
return false;
}
}
{
DateTimeObjectPropertyType lhsFirstRun;
lhsFirstRun = this.getFirstRun();
DateTimeObjectPropertyType rhsFirstRun;
rhsFirstRun = that.getFirstRun();
if (!strategy
.equals(LocatorUtils.property(thisLocator, "firstRun",
lhsFirstRun), LocatorUtils.property(thatLocator,
"firstRun", rhsFirstRun), lhsFirstRun, rhsFirstRun)) {
return false;
}
}
{
DateTimeObjectPropertyType lhsLastRun;
lhsLastRun = this.getLastRun();
DateTimeObjectPropertyType rhsLastRun;
rhsLastRun = that.getLastRun();
if (!strategy.equals(
LocatorUtils.property(thisLocator, "lastRun", lhsLastRun),
LocatorUtils.property(thatLocator, "lastRun", rhsLastRun),
lhsLastRun, rhsLastRun)) {
return false;
}
}
{
VolumeType lhsVolume;
lhsVolume = this.getVolume();
VolumeType rhsVolume;
rhsVolume = that.getVolume();
if (!strategy.equals(
LocatorUtils.property(thisLocator, "volume", lhsVolume),
LocatorUtils.property(thatLocator, "volume", rhsVolume),
lhsVolume, rhsVolume)) {
return false;
}
}
{
AccessedFileListType lhsAccessedFileList;
lhsAccessedFileList = this.getAccessedFileList();
AccessedFileListType rhsAccessedFileList;
rhsAccessedFileList = that.getAccessedFileList();
if (!strategy.equals(LocatorUtils.property(thisLocator,
"accessedFileList", lhsAccessedFileList), LocatorUtils
.property(thatLocator, "accessedFileList",
rhsAccessedFileList), lhsAccessedFileList,
rhsAccessedFileList)) {
return false;
}
}
{
AccessedDirectoryListType lhsAccessedDirectoryList;
lhsAccessedDirectoryList = this.getAccessedDirectoryList();
AccessedDirectoryListType rhsAccessedDirectoryList;
rhsAccessedDirectoryList = that.getAccessedDirectoryList();
if (!strategy.equals(LocatorUtils.property(thisLocator,
"accessedDirectoryList", lhsAccessedDirectoryList),
LocatorUtils.property(thatLocator, "accessedDirectoryList",
rhsAccessedDirectoryList),
lhsAccessedDirectoryList, rhsAccessedDirectoryList)) {
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);
{
StringObjectPropertyType theApplicationFileName;
theApplicationFileName = this.getApplicationFileName();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator,
"applicationFileName", theApplicationFileName),
currentHashCode, theApplicationFileName);
}
{
StringObjectPropertyType thePrefetchHash;
thePrefetchHash = this.getPrefetchHash();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator,
"prefetchHash", thePrefetchHash), currentHashCode,
thePrefetchHash);
}
{
LongObjectPropertyType theTimesExecuted;
theTimesExecuted = this.getTimesExecuted();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator,
"timesExecuted", theTimesExecuted), currentHashCode,
theTimesExecuted);
}
{
DateTimeObjectPropertyType theFirstRun;
theFirstRun = this.getFirstRun();
currentHashCode = strategy.hashCode(
LocatorUtils.property(locator, "firstRun", theFirstRun),
currentHashCode, theFirstRun);
}
{
DateTimeObjectPropertyType theLastRun;
theLastRun = this.getLastRun();
currentHashCode = strategy.hashCode(
LocatorUtils.property(locator, "lastRun", theLastRun),
currentHashCode, theLastRun);
}
{
VolumeType theVolume;
theVolume = this.getVolume();
currentHashCode = strategy.hashCode(
LocatorUtils.property(locator, "volume", theVolume),
currentHashCode, theVolume);
}
{
AccessedFileListType theAccessedFileList;
theAccessedFileList = this.getAccessedFileList();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator,
"accessedFileList", theAccessedFileList), currentHashCode,
theAccessedFileList);
}
{
AccessedDirectoryListType theAccessedDirectoryList;
theAccessedDirectoryList = this.getAccessedDirectoryList();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator,
"accessedDirectoryList", theAccessedDirectoryList),
currentHashCode, theAccessedDirectoryList);
}
return currentHashCode;
}
public int hashCode() {
final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
return this.hashCode(null, strategy);
}
public WindowsPrefetchEntry withApplicationFileName(
StringObjectPropertyType value) {
setApplicationFileName(value);
return this;
}
public WindowsPrefetchEntry withPrefetchHash(StringObjectPropertyType value) {
setPrefetchHash(value);
return this;
}
public WindowsPrefetchEntry withTimesExecuted(LongObjectPropertyType value) {
setTimesExecuted(value);
return this;
}
public WindowsPrefetchEntry withFirstRun(DateTimeObjectPropertyType value) {
setFirstRun(value);
return this;
}
public WindowsPrefetchEntry withLastRun(DateTimeObjectPropertyType value) {
setLastRun(value);
return this;
}
public WindowsPrefetchEntry withVolume(VolumeType value) {
setVolume(value);
return this;
}
public WindowsPrefetchEntry withAccessedFileList(AccessedFileListType value) {
setAccessedFileList(value);
return this;
}
public WindowsPrefetchEntry withAccessedDirectoryList(
AccessedDirectoryListType value) {
setAccessedDirectoryList(value);
return this;
}
@Override
public WindowsPrefetchEntry withCustomProperties(CustomPropertiesType value) {
setCustomProperties(value);
return this;
}
@Override
public WindowsPrefetchEntry 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);
{
StringObjectPropertyType theApplicationFileName;
theApplicationFileName = this.getApplicationFileName();
strategy.appendField(locator, this, "applicationFileName", buffer,
theApplicationFileName);
}
{
StringObjectPropertyType thePrefetchHash;
thePrefetchHash = this.getPrefetchHash();
strategy.appendField(locator, this, "prefetchHash", buffer,
thePrefetchHash);
}
{
LongObjectPropertyType theTimesExecuted;
theTimesExecuted = this.getTimesExecuted();
strategy.appendField(locator, this, "timesExecuted", buffer,
theTimesExecuted);
}
{
DateTimeObjectPropertyType theFirstRun;
theFirstRun = this.getFirstRun();
strategy.appendField(locator, this, "firstRun", buffer, theFirstRun);
}
{
DateTimeObjectPropertyType theLastRun;
theLastRun = this.getLastRun();
strategy.appendField(locator, this, "lastRun", buffer, theLastRun);
}
{
VolumeType theVolume;
theVolume = this.getVolume();
strategy.appendField(locator, this, "volume", buffer, theVolume);
}
{
AccessedFileListType theAccessedFileList;
theAccessedFileList = this.getAccessedFileList();
strategy.appendField(locator, this, "accessedFileList", buffer,
theAccessedFileList);
}
{
AccessedDirectoryListType theAccessedDirectoryList;
theAccessedDirectoryList = this.getAccessedDirectoryList();
strategy.appendField(locator, this, "accessedDirectoryList",
buffer, theAccessedDirectoryList);
}
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, WindowsPrefetchEntry.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 WindowsPrefetchEntry instance for XML String
*
* @param text
* XML String for the document
* @return The WindowsPrefetchEntry instance for the passed XML String
*/
public static WindowsPrefetchEntry fromXMLString(String text) {
JAXBContext jaxbContext;
try {
jaxbContext = JAXBContext.newInstance(WindowsPrefetchEntry.class
.getPackage().getName());
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
unmarshaller.setSchema(STIXSchema.getInstance().getSchema());
unmarshaller.setEventHandler(new ValidationEventHandler());
StreamSource streamSource = new StreamSource(new StringReader(text));
return (WindowsPrefetchEntry) unmarshaller.unmarshal(streamSource);
} catch (JAXBException e) {
throw new RuntimeException(e);
}
}
/**
* Validates the XML representation of this WindowsPrefetchEntry 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());
}
}