1 23 package org.apache.slide.store.mem; 24 25 import org.apache.slide.common.Uri; 26 import org.apache.slide.content.NodeRevisionNumber; 27 28 29 33 class VersionedUriKey { 34 private String uri; 35 private String version; 36 VersionedUriKey(Uri uri, NodeRevisionNumber number) 37 { 38 this.uri = uri.toString(); 39 if (number == null) { 40 this.version = "null"; 41 } else { 42 this.version = number.toString(); 43 } 44 } 45 public boolean equals(Object obj) 46 { 47 if (obj == this) return true; 48 if (obj instanceof VersionedUriKey) { 49 VersionedUriKey that = (VersionedUriKey)obj; 50 return this.uri.equals(that.uri) && this.version.equals(that.version); 51 } 52 return false; 53 } 54 public int hashCode() 55 { 56 return (uri.hashCode() ^ version.hashCode()); 57 } 58 public String toString() 59 { 60 return uri + " - " + version; 61 } 62 } | Popular Tags |