package gw.solr.utils uses org.json.simple.JSONObject /** * Wrapper class for entity versioning used by the consistency tracker */ @ReadOnly final class EntityKey { var _type : String as EntityType var _publicID : String as PublicID var _ID : String as ID construct( type : String, pubID : String, plainId : String ) { _type = type _publicID = pubID _ID = plainId } construct( jsonObj : JSONObject ) { _type = jsonObj.get(PLSolrUtils.BEAN_TYPE_TAG) as String _publicID = jsonObj.get(PLSolrUtils.BEAN_PUBLIC_ID_TAG) as String _ID = jsonObj.get(PLSolrUtils.BEAN_ID_TAG) as String } override function equals(o : Object) : boolean { if(o === this) { return true } if(!(o typeis EntityKey)) { return false } var oek = o as EntityKey return _type.equals(oek.EntityType) && _publicID.equals(oek.PublicID) } override function hashCode() : int { return 37 * _type.hashCode() + _publicID.hashCode() } override function toString() : String { return _type + ":" + _publicID } }