org.obolibrary.oboformat.model.QualifierValue Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of owlapi-oboformat Show documentation
Show all versions of owlapi-oboformat Show documentation
A java library for converting obo format documents to OWL, and for converting (a subset of) OWL to obo format. This version has been slightly modified to be included directly in the OWL API.
The upstream code for this module and its authors can be found at https://code.google.com/p/oboformat/.
package org.obolibrary.oboformat.model;
import javax.annotation.Nonnull;
/** qualifier value */
public class QualifierValue implements Comparable {
@Nonnull
protected String qualifier;
@Nonnull
protected String value;
/**
* @param q
* qualifier
* @param v
* value
*/
public QualifierValue(@Nonnull String q, @Nonnull String v) {
qualifier = q;
value = v;
}
/**
* @return qualifier
*/
@Nonnull
public String getQualifier() {
return qualifier;
}
/**
* @param qualifier
* qualifier
*/
public void setQualifier(@Nonnull String qualifier) {
this.qualifier = qualifier;
}
/**
* @return value
*/
@Nonnull
public String getValue() {
return value;
}
/**
* @param value
* value
*/
public void setValue(@Nonnull String value) {
this.value = value;
}
@Nonnull
@Override
public String toString() {
return '{' + qualifier + '=' + value + '}';
}
@Override
public int hashCode() {
int prime = 31;
int result = 1;
result = prime * result + qualifier.hashCode();
result = prime * result + value.hashCode();
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof QualifierValue)) {
return false;
}
QualifierValue other = (QualifierValue) obj;
if (!qualifier.equals(other.qualifier)) {
return false;
} else if (!value.equals(other.value)) {
return false;
}
return true;
}
@Override
public int compareTo(QualifierValue o) {
if (o == null) {
return 1;
}
// use toString representation
return toString().compareTo(o.toString());
}
}