1 package org.gnomekr.potron.data; 2 3 import java.io.Serializable; 4 5 import org.apache.commons.lang.builder.EqualsBuilder; 6 import org.apache.commons.lang.builder.HashCodeBuilder; 7 import org.apache.commons.lang.builder.ToStringBuilder; 8 9 /*** 10 * Header.java 11 * @author Xavier Cho 12 * @version $Revision 1.1 $ $Date: 2005/09/11 05:49:44 $ 13 */ 14 public class Header implements Serializable { 15 16 private static final long serialVersionUID = -7366433773194011779L; 17 18 private String name; 19 private String value; 20 21 public Header() { 22 } 23 24 /*** 25 * @param name 26 * @param value 27 */ 28 public Header(String name, String value) { 29 this.name = name; 30 this.value = value; 31 } 32 33 /*** 34 * @return Returns the name. 35 * @hibernate.property 36 * column = "name" 37 * length = "200" 38 * update = "true" 39 * not-null = "true" 40 */ 41 public String getName() { 42 return name; 43 } 44 45 /*** 46 * @param name The name to set. 47 */ 48 public void setName(String name) { 49 this.name = name; 50 } 51 52 /*** 53 * @return Returns the value. 54 * @hibernate.property 55 * column = "value" 56 * length = "400" 57 * update = "true" 58 * not-null = "true" 59 */ 60 public String getValue() { 61 return value; 62 } 63 64 /*** 65 * @param value The value to set. 66 */ 67 public void setValue(String value) { 68 this.value = value; 69 } 70 71 /*** 72 * @see java.lang.Object#equals(java.lang.Object) 73 */ 74 public boolean equals(final Object object) { 75 if (object instanceof Header) { 76 Header header = (Header) object; 77 78 EqualsBuilder builder = new EqualsBuilder(); 79 builder.append(name, header.getName()); 80 builder.append(value, header.getValue()); 81 82 return builder.isEquals(); 83 } 84 85 return false; 86 } 87 88 /*** 89 * @see java.lang.Object#toString() 90 */ 91 public String toString() { 92 ToStringBuilder builder = new ToStringBuilder(this); 93 builder.append("name", name); 94 builder.append("value", value); 95 96 return builder.toString(); 97 } 98 99 /*** 100 * @see java.lang.Object#hashCode() 101 */ 102 public int hashCode() { 103 HashCodeBuilder builder = new HashCodeBuilder(); 104 builder.append(name); 105 builder.append(value); 106 return builder.toHashCode(); 107 } 108 }