Subversion Repositories SmartDukaan

Rev

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

package com.spice.profitmandi.dao.model;

import com.spice.profitmandi.dao.enumuration.catalog.AmountType;

import java.util.Objects;

public class AmountModel implements java.io.Serializable {
        private static final long serialVersionUID = 1L;

        private double amount;
        private AmountType amountType;
        private double value;
        private boolean discount = false;

        public AmountModel() {
        }

        public AmountModel(double amount, AmountType amountType) {
                this.amount = amount;
                this.amountType = amountType;
        }

        public double getValue() {
                return value;
        }

        public void setValue(double value) {
                this.value = value;
        }

        public double getAmount() {
                return amount;
        }

        public void setAmount(double amount) {
                this.amount = amount;
        }

        public AmountType getAmountType() {
                return amountType;
        }

        public void setAmountType(AmountType amountType) {
                this.amountType = amountType;
        }

        public boolean isDiscount() {
                return discount;
        }

        public void setDiscount(boolean discount) {
                this.discount = discount;
        }

        @Override
        public boolean equals(Object o) {
                if (this == o) return true;
                if (o == null || getClass() != o.getClass()) return false;
                AmountModel that = (AmountModel) o;
                return Double.compare(that.amount, amount) == 0 && Double.compare(that.value, value) == 0 && discount == that.discount && amountType == that.amountType;
        }

        @Override
        public int hashCode() {
                return Objects.hash(amount, amountType, value, discount);
        }

        @Override
        public String toString() {
                return "AmountModel{" +
                                "amount=" + amount +
                                ", amountType=" + amountType +
                                ", value=" + value +
                                ", discount=" + discount +
                                '}';
        }
}