1 17 package org.alfresco.repo.domain; 18 19 import java.io.Serializable ; 20 21 import org.alfresco.util.EqualsHelper; 22 23 28 public class StoreKey implements Serializable 29 { 30 private static final long serialVersionUID = 3618140052220096569L; 31 32 private String protocol; 33 private String identifier; 34 35 public StoreKey() 36 { 37 } 38 39 public StoreKey(String protocol, String identifier) 40 { 41 setProtocol(protocol); 42 setIdentifier(identifier); 43 } 44 45 public String toString() 46 { 47 return ("StoreKey[" + 48 " protocol=" + protocol + 49 ", identifier=" + identifier + 50 "]"); 51 } 52 53 public int hashCode() 54 { 55 return (this.protocol.hashCode() + this.identifier.hashCode()); 56 } 57 58 public boolean equals(Object obj) 59 { 60 if (this == obj) 61 { 62 return true; 63 } 64 else if (!(obj instanceof StoreKey)) 65 { 66 return false; 67 } 68 StoreKey that = (StoreKey) obj; 69 return (EqualsHelper.nullSafeEquals(this.protocol, that.protocol) && 70 EqualsHelper.nullSafeEquals(this.identifier, that.identifier)); 71 } 72 73 public String getProtocol() 74 { 75 return protocol; 76 } 77 78 81 private void setProtocol(String protocol) 82 { 83 this.protocol = protocol; 84 } 85 86 public String getIdentifier() 87 { 88 return identifier; 89 } 90 91 94 private void setIdentifier(String identifier) 95 { 96 this.identifier = identifier; 97 } 98 } 99 | Popular Tags |