1 package org.apache.ojb.performance; 2 3 import org.apache.commons.lang.builder.ToStringBuilder; 4 import org.apache.commons.lang.builder.HashCodeBuilder; 5 import org.apache.commons.lang.builder.EqualsBuilder; 6 7 21 22 27 public class PerfArticleImpl implements PerfArticle 28 { 29 private Long articleId; 30 private String articleName; 31 private int minimumStock; 32 private double price; 33 private String unit; 34 private int stock; 35 private int supplierId; 36 private int productGroupId; 37 38 public PerfArticleImpl() 39 { 40 } 41 42 public PerfArticleImpl(Long articleId, String articleName, int minimumStock, double price, String unit, int stock, int supplierId, int productGroupId) 43 { 44 this.articleId = articleId; 45 this.articleName = articleName; 46 this.minimumStock = minimumStock; 47 this.price = price; 48 this.unit = unit; 49 this.stock = stock; 50 this.supplierId = supplierId; 51 this.productGroupId = productGroupId; 52 } 53 54 public String toString() 55 { 56 return new ToStringBuilder(this).append("articleId", articleId) 57 .append("articleName", articleName) 58 .append("minimumStock", minimumStock) 59 .append("price", price) 60 .append("unit", unit) 61 .append("stock", stock) 62 .append("supplierId", supplierId) 63 .append("productGroupId", productGroupId) 64 .toString(); 65 } 66 67 public Long getArticleId() 68 { 69 return articleId; 70 } 71 72 public void setArticleId(Long articleId) 73 { 74 this.articleId = articleId; 75 } 76 77 public String getArticleName() 78 { 79 return articleName; 80 } 81 82 public void setArticleName(String articleName) 83 { 84 this.articleName = articleName; 85 } 86 87 public int getMinimumStock() 88 { 89 return minimumStock; 90 } 91 92 public void setMinimumStock(int minimumStock) 93 { 94 this.minimumStock = minimumStock; 95 } 96 97 public double getPrice() 98 { 99 return price; 100 } 101 102 public void setPrice(double price) 103 { 104 this.price = price; 105 } 106 107 public String getUnit() 108 { 109 return unit; 110 } 111 112 public void setUnit(String unit) 113 { 114 this.unit = unit; 115 } 116 117 public int getStock() 118 { 119 return stock; 120 } 121 122 public void setStock(int stock) 123 { 124 this.stock = stock; 125 } 126 127 public int getSupplierId() 128 { 129 return supplierId; 130 } 131 132 public void setSupplierId(int supplierId) 133 { 134 this.supplierId = supplierId; 135 } 136 137 public int getProductGroupId() 138 { 139 return productGroupId; 140 } 141 142 public void setProductGroupId(int productGroupId) 143 { 144 this.productGroupId = productGroupId; 145 } 146 147 public int hashCode() 148 { 149 return new HashCodeBuilder().append(articleId).hashCode(); 150 } 151 152 public boolean equals(Object obj) 153 { 154 if(obj == this) 155 { 156 return true; 157 } 158 if(obj instanceof PerfArticleImpl) 159 { 160 PerfArticleImpl o = (PerfArticleImpl) obj; 161 return new EqualsBuilder() 162 .append(articleId, o.articleId) 163 .append(articleName, o.articleName) 164 .append(minimumStock, o.minimumStock) 165 .append(price, o.price) 166 .append(productGroupId, o.productGroupId) 167 .append(stock, o.stock) 168 .append(supplierId, o.supplierId) 169 .append(unit, o.unit) 170 .isEquals(); 171 } 172 return false; 173 } 174 } 175 | Popular Tags |