blob: 1eaaa8a85488fd38fbe28bbf53aaf3382fc17a43 [file] [log] [blame]
package aQute.lib.deployer.obr;
/**
* @immutable
* @author Neil Bartlett
*/
public class Property {
static final String PACKAGE = "package";
static final String USES = "uses";
static final String VERSION = "version";
private final String name;
private final String type;
private final String value;
public Property(String name, String type, String value) {
this.name = name;
this.type = type;
this.value = value;
}
public String getName() {
return name;
}
public String getType() {
return type;
}
public String getValue() {
return value;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("Property [name=").append(name).append(", type=").append(type).append(", value=").append(value).append("]");
return builder.toString();
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((type == null) ? 0 : type.hashCode());
result = prime * result + ((value == null) ? 0 : value.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Property other = (Property) obj;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
if (type == null) {
if (other.type != null)
return false;
} else if (!type.equals(other.type))
return false;
if (value == null) {
if (other.value != null)
return false;
} else if (!value.equals(other.value))
return false;
return true;
}
}