1 package johnmammen.betterpetshop.bo; 2 3 import java.io.Serializable ; 4 import java.math.BigDecimal ; 5 6 import org.apache.commons.lang.builder.EqualsBuilder; 7 import org.apache.commons.lang.builder.HashCodeBuilder; 8 import org.apache.commons.lang.builder.ToStringBuilder; 9 import org.apache.tapestry.pets.domain.model.IItem; 10 11 12 13 18 public class Lineitem implements Serializable { 19 20 21 private johnmammen.betterpetshop.bo.LineitemPK comp_id; 22 23 24 private int quantity; 25 26 27 private BigDecimal unitprice; 28 29 30 private org.apache.tapestry.pets.domain.model.IItem item; 31 32 33 public Lineitem(johnmammen.betterpetshop.bo.LineitemPK comp_id, int quantity, BigDecimal unitprice, IItem item) { 34 this.comp_id = comp_id; 35 this.quantity = quantity; 36 this.unitprice = unitprice; 37 this.item = item; 38 } 39 40 41 public Lineitem() { 42 } 43 44 45 public Lineitem(johnmammen.betterpetshop.bo.LineitemPK comp_id, int quantity, BigDecimal unitprice) { 46 this.comp_id = comp_id; 47 this.quantity = quantity; 48 this.unitprice = unitprice; 49 } 50 51 public johnmammen.betterpetshop.bo.LineitemPK getComp_id() { 52 return this.comp_id; 53 } 54 55 public void setComp_id(johnmammen.betterpetshop.bo.LineitemPK comp_id) { 56 this.comp_id = comp_id; 57 } 58 59 66 public int getQuantity() { 67 return this.quantity; 68 } 69 70 public void setQuantity(int quantity) { 71 this.quantity = quantity; 72 } 73 74 81 public BigDecimal getUnitprice() { 82 return this.unitprice; 83 } 84 85 public void setUnitprice(BigDecimal unitprice) { 86 this.unitprice = unitprice; 87 } 88 89 94 public IItem getItem() { 95 return this.item; 96 } 97 98 public void setItem(IItem item) { 99 this.item = item; 100 } 101 102 public String toString() { 103 return new ToStringBuilder(this) 104 .append("comp_id", getComp_id()) 105 .toString(); 106 } 107 108 public boolean equals(Object other) { 109 if ( (other == other ) ) return true; 110 if ( !(other instanceof Lineitem) ) return false; 111 Lineitem castOther = (Lineitem) other; 112 return new EqualsBuilder() 113 .append(this.getComp_id(), castOther.getComp_id()) 114 .isEquals(); 115 } 116 117 public int hashCode() { 118 return new HashCodeBuilder() 119 .append(getComp_id()) 120 .toHashCode(); 121 } 122 123 } 124 | Popular Tags |