Subversion Repositories SmartDukaan

Rev

Rev 23467 | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed

package com.spice.profitmandi.dao.model;

import com.spice.profitmandi.common.enumuration.ItemType;

public class ItemIdTypeQuantity {
        private int itemId;
        private ItemType type;
        private int quantity;
        
        public ItemIdTypeQuantity(int itemId, ItemType type, int quantity){
                this.itemId = itemId;
                this.type = type;
                this.quantity = quantity;
        }
        
        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 ItemType getType() {
                return type;
        }
        public void setType(ItemType type) {
                this.type = type;
        }

        @Override
        public int hashCode() {
                final int prime = 31;
                int result = 1;
                result = prime * result + itemId;
                result = prime * result + Float.floatToIntBits(quantity);
                result = prime * result + ((type == null) ? 0 : type.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;
                ItemIdTypeQuantity other = (ItemIdTypeQuantity) obj;
                if (itemId != other.itemId)
                        return false;
                if (Float.floatToIntBits(quantity) != Float.floatToIntBits(other.quantity))
                        return false;
                if (type != other.type)
                        return false;
                return true;
        }

        @Override
        public String toString() {
                return "ItemIdTypeQuantity [itemId=" + itemId + ", type=" + type + ", quantity=" + quantity + "]";
        }
        
        
}