for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
package it.cnr.istc.pst.cognition.koala.reasoner.environment.parser.xml;
/**
*
* @author alessandroumbrico
*/
public class Element
{
private String id;
private String name;
private String type;
private Element partOf;
* @param id
* @param name
* @param type
protected Element(String id, String name, String type) {
this.id = id;
this.name = name;
this.type = type;
this.partOf = null;
}
* @param element
protected Element(String id, String name, String type, Element element) {
this(id, name, type);
this.partOf = element;
* @return
public String getId() {
return id;
public String getName() {
return name;
public Element getPartOf() {
return partOf;
* @param partOf
public void setPartOf(Element partOf) {
this.partOf = partOf;
public String getType() {
return type;
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
return result;
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
Element other = (Element) obj;
if (id == null) {
if (other.id != null)
} else if (!id.equals(other.id))
if (name == null) {
if (other.name != null)
} else if (!name.equals(other.name))
public String toString() {
return "[Element id=" + this.id + ", name= " + this.name + ", type= \"" + this.type + "\"]";