1 40 41 package com.sun.jmx.examples.scandir.config; 42 43 import java.util.Arrays ; 44 import javax.xml.bind.annotation.XmlElement; 45 import javax.xml.bind.annotation.XmlRootElement; 46 47 58 @XmlRootElement(name="ResultLogConfig", 59 namespace=XmlConfigUtils.NAMESPACE) 60 public class ResultLogConfig { 61 62 68 72 private String logFileName; 73 74 78 private long logFileMaxRecords; 79 80 85 private int memoryMaxRecords; 86 87 90 public ResultLogConfig() { 91 } 92 93 98 @XmlElement(name="LogFileName",namespace=XmlConfigUtils.NAMESPACE) 99 public String getLogFileName() { 100 return this.logFileName; 101 } 102 103 108 public void setLogFileName(String logFileName) { 109 this.logFileName = logFileName; 110 } 111 112 118 @XmlElement(name="LogFileMaxRecords",namespace=XmlConfigUtils.NAMESPACE) 119 public long getLogFileMaxRecords() { 120 return this.logFileMaxRecords; 121 } 122 123 130 public void setLogFileMaxRecords(long logFileMaxRecords) { 131 this.logFileMaxRecords = logFileMaxRecords; 132 } 133 134 142 @XmlElement(name="MemoryMaxRecords",namespace=XmlConfigUtils.NAMESPACE) 143 public int getMemoryMaxRecords() { 144 return this.memoryMaxRecords; 145 } 146 147 155 public void setMemoryMaxRecords(int memoryMaxRecords) { 156 this.memoryMaxRecords = memoryMaxRecords; 157 } 158 159 private Object [] toArray() { 160 final Object [] thisconfig = { 161 memoryMaxRecords,logFileMaxRecords,logFileName 162 }; 163 return thisconfig; 164 } 165 166 @Override 167 public boolean equals(Object o) { 168 if (o == this) return true; 169 if (!(o instanceof ResultLogConfig)) return false; 170 final ResultLogConfig other = (ResultLogConfig)o; 171 return Arrays.deepEquals(toArray(),other.toArray()); 172 } 173 174 @Override 175 public int hashCode() { 176 return Arrays.deepHashCode(toArray()); 177 } 178 } 179 | Popular Tags |