1 7 package org.jboss.cache.config; 8 9 import org.jboss.cache.optimistic.DataVersion; 10 11 17 public class Option implements Cloneable 18 { 19 private boolean failSilently; 20 private boolean cacheModeLocal; 21 private DataVersion dataVersion; 22 private boolean suppressLocking; 23 private boolean forceDataGravitation; 24 private boolean bypassInterceptorChain; 25 26 30 public boolean isBypassInterceptorChain() 31 { 32 return bypassInterceptorChain; 33 } 34 35 41 public void setBypassInterceptorChain(boolean bypassInterceptorChain) 42 { 43 this.bypassInterceptorChain = bypassInterceptorChain; 44 } 45 46 49 public boolean isSuppressLocking() 50 { 51 return suppressLocking; 52 } 53 54 59 public void setSuppressLocking(boolean suppressLocking) 60 { 61 this.suppressLocking = suppressLocking; 62 } 63 64 65 68 public boolean isFailSilently() 69 { 70 return failSilently; 71 } 72 73 78 public void setFailSilently(boolean failSilently) 79 { 80 this.failSilently = failSilently; 81 } 82 83 88 public boolean isCacheModeLocal() 89 { 90 return cacheModeLocal; 91 } 92 93 99 public void setCacheModeLocal(boolean cacheModeLocal) 100 { 101 this.cacheModeLocal = cacheModeLocal; 102 } 103 104 107 public DataVersion getDataVersion() 108 { 109 return dataVersion; 110 } 111 112 117 public void setDataVersion(DataVersion dataVersion) 118 { 119 this.dataVersion = dataVersion; 120 } 121 122 125 public boolean getForceDataGravitation() 126 { 127 return forceDataGravitation; 128 } 129 130 137 public void setForceDataGravitation(boolean enableDataGravitation) 138 { 139 this.forceDataGravitation = enableDataGravitation; 140 } 141 142 143 public String toString() 144 { 145 return "Option{" + 146 "failSilently=" + failSilently + 147 ", cacheModeLocal=" + cacheModeLocal + 148 ", dataVersion=" + dataVersion + 149 ", suppressLocking=" + suppressLocking + 150 ", forceDataGravitation=" + forceDataGravitation + 151 ", bypassInterceptorChain=" + bypassInterceptorChain + 152 '}'; 153 } 154 155 public Option clone() throws CloneNotSupportedException 156 { 157 return (Option) super.clone(); 158 } 159 160 161 public boolean equals(Object o) 162 { 163 if (this == o) return true; 164 if (o == null || getClass() != o.getClass()) return false; 165 166 final Option option = (Option) o; 167 168 if (bypassInterceptorChain != option.bypassInterceptorChain) return false; 169 if (cacheModeLocal != option.cacheModeLocal) return false; 170 if (failSilently != option.failSilently) return false; 171 if (forceDataGravitation != option.forceDataGravitation) return false; 172 if (suppressLocking != option.suppressLocking) return false; 173 if (dataVersion != null ? !dataVersion.equals(option.dataVersion) : option.dataVersion != null) return false; 174 175 return true; 176 } 177 178 public int hashCode() 179 { 180 int result; 181 result = (failSilently ? 1 : 0); 182 result = 29 * result + (cacheModeLocal ? 1 : 0); 183 result = 29 * result + (dataVersion != null ? dataVersion.hashCode() : 0); 184 result = 29 * result + (suppressLocking ? 1 : 0); 185 result = 29 * result + (forceDataGravitation ? 1 : 0); 186 result = 29 * result + (bypassInterceptorChain ? 1 : 0); 187 return result; 188 } 189 190 193 public void reset() 194 { 195 this.bypassInterceptorChain = false; 196 this.cacheModeLocal = false; 197 this.failSilently = false; 198 this.forceDataGravitation = false; 199 this.suppressLocking = false; 200 this.dataVersion = null; 201 } 202 } 203 | Popular Tags |