package mediawiki.info.wikibase; import org.json.JSONException; import org.json.JSONObject; import javat.xml.Element; public class Qualifier extends Claim { private String hash = null; public Qualifier(Property p, ValueSnak<?> e) { super(p, e); } public Qualifier(Element e) throws Exception { super(e); } @Override public void convert(Element element) throws Exception { super.convert(element); setHash(element.getAttribute("hash").getValue()); } public String getHash() { return hash; } public void setHash(String hash) { this.hash = hash; } @Override public JSONObject toJSONObject() throws JSONException { JSONObject o = super.toJSONObject(); if(hash != null) o.put("hash", hash); return o; } @Override public boolean equals(Object obj) { return super.equals(obj) && (hash == null || hash.equals(((Qualifier) obj).hash) ); } }