com.trend.cloudone.amaas.MalwareItem Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of file-security-java-sdk Show documentation
Show all versions of file-security-java-sdk Show documentation
Trend Vision One File Security Java SDK
The newest version!
package com.trend.cloudone.amaas;
/**
* Data object for converting found malwares in the json scan result returned by AMaaS scanning APIs.
*/
public class MalwareItem {
private String malwareName;
private String fileName;
/**
* Constructor for an malware object returned in AMaaS json scan result.
* @param malwareName name of detected malware
* @param fileName file name that the malware was detected
*/
public MalwareItem(final String malwareName, final String fileName) {
this.malwareName = malwareName;
this.fileName = fileName;
}
/**
* Get Malware name.
* @return malware name
*/
public String getMalwareName() {
return malwareName;
}
/**
* Get file name that the malware was detected.
* @return file name
*/
public String getFileName() {
return fileName;
}
/**
* Set malware name.
* @param malwareName malware name to set
*/
public void setMalwareName(final String malwareName) {
this.malwareName = malwareName;
}
/**
* Set file name that the malware was detected.
* @param fileName file name to set
*/
public void setFileName(final String fileName) {
this.fileName = fileName;
}
/**
* Compute the hash code of MalwareItem object.
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((malwareName == null) ? 0 : malwareName.hashCode());
result = prime * result + ((fileName == null) ? 0 : fileName.hashCode());
return result;
}
/**
* Compare the equality against a given object.
* @param obj object to be compared with.
* @return true if equal; false otherwise.
*/
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
MalwareItem other = (MalwareItem) obj;
if (malwareName == null) {
if (other.malwareName != null) {
return false;
}
} else if (!malwareName.equals(other.malwareName)) {
return false;
}
if (fileName == null) {
if (other.fileName != null) {
return false;
}
} else if (!fileName.equals(other.fileName)) {
return false;
}
return true;
}
}