Subversion Repositories SmartDukaan

Rev

Rev 22869 | Rev 33399 | Go to most recent revision | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed

package com.spice.profitmandi.common.model;

import java.util.Set;

public class CustomFofoOrderItem {
        private int itemId;
        private int quantity;
        private float sellingPrice;
        private float discountAmount;
        private boolean prebookingOrder;
        private Set<SerialNumberDetail> serialNumberDetails;
        
        public int getItemId() {
                return itemId;
        }
        public void setItemId(int itemId) {
                this.itemId = itemId;
        }
        public int getQuantity() {
                return quantity;
        }
        public void setQuantity(int quantity) {
                this.quantity = quantity;
        }
        public float getSellingPrice() {
                return sellingPrice;
        }
        public void setSellingPrice(float sellingPrice) {
                this.sellingPrice = sellingPrice;
        }
        public float getDiscountAmount() {
                return discountAmount;
        }
        public void setDiscountAmount(float discountAmount) {
                this.discountAmount = discountAmount;
        }
        public boolean isPrebookingOrder() {
                return prebookingOrder;
        }
        public void setPrebookingOrder(boolean prebookingOrder) {
                this.prebookingOrder = prebookingOrder;
        }
        public Set<SerialNumberDetail> getSerialNumberDetails() {
                return serialNumberDetails;
        }
        public void setSerialNumberDetails(Set<SerialNumberDetail> serialNumberDetails) {
                this.serialNumberDetails = serialNumberDetails;
        }
        
        @Override
        public int hashCode() {
                final int prime = 31;
                int result = 1;
                result = prime * result + Float.floatToIntBits(discountAmount);
                result = prime * result + itemId;
                result = prime * result + (prebookingOrder ? 1231 : 1237);
                result = prime * result + quantity;
                result = prime * result + Float.floatToIntBits(sellingPrice);
                result = prime * result + ((serialNumberDetails == null) ? 0 : serialNumberDetails.hashCode());
                return result;
        }
        
        @Override
        public boolean equals(Object obj) {
                if (this == obj)
                        return true;
                if (obj == null)
                        return false;
                if (getClass() != obj.getClass())
                        return false;
                CustomFofoOrderItem other = (CustomFofoOrderItem) obj;
                if (Float.floatToIntBits(discountAmount) != Float.floatToIntBits(other.discountAmount))
                        return false;
                if (itemId != other.itemId)
                        return false;
                if (prebookingOrder != other.prebookingOrder)
                        return false;
                if (quantity != other.quantity)
                        return false;
                if (Float.floatToIntBits(sellingPrice) != Float.floatToIntBits(other.sellingPrice))
                        return false;
                if (serialNumberDetails == null) {
                        if (other.serialNumberDetails != null)
                                return false;
                } else if (!serialNumberDetails.equals(other.serialNumberDetails))
                        return false;
                return true;
        }
        
        @Override
        public String toString() {
                return "CustomFofoOrderItem [itemId=" + itemId + ", quantity=" + quantity + ", sellingPrice=" + sellingPrice
                                + ", discountAmount=" + discountAmount + ", prebookingOrder=" + prebookingOrder
                                + ", serialNumberDetails=" + serialNumberDetails + "]";
        }
        
}