1 10 11 package org.mule.impl.container; 12 13 18 public class ContainerKeyPair 19 { 20 private final String containerName; 21 private final Object key; 22 private final boolean required; 23 24 public ContainerKeyPair(String containerName, Object key) 25 { 26 this.containerName = containerName; 27 this.key = key; 28 this.required = true; 29 } 30 31 public ContainerKeyPair(String containerName, Object key, boolean required) 32 { 33 this.containerName = containerName; 34 this.key = key; 35 this.required = required; 36 } 37 38 public String getContainerName() 39 { 40 return containerName; 41 } 42 43 public Object getKey() 44 { 45 return key; 46 } 47 48 public boolean isRequired() 49 { 50 return required; 51 } 52 53 public String toString() 57 { 58 return key.toString(); 59 } 60 61 public String toFullString() 62 { 63 return "Container Key{key=" + key.toString() + ", container=" + containerName + ", required=" 64 + required + "}"; 65 } 66 67 public boolean equals(Object o) 68 { 69 if (this == o) return true; 70 if (o == null || getClass() != o.getClass()) return false; 71 72 final ContainerKeyPair that = (ContainerKeyPair)o; 73 74 if (!containerName.equals(that.containerName)) return false; 75 if (!key.equals(that.key)) return false; 76 77 return true; 78 } 79 80 public int hashCode() 81 { 82 return 29 * containerName.hashCode() + key.hashCode(); 83 } 84 } 85 | Popular Tags |