Subversion Repositories SmartDukaan

Rev

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

package com.spice.profitmandi.service.offers;

public class PayoutSlab implements Comparable<PayoutSlab>, java.io.Serializable {
        private static final long serialVersionUID = 1L;
        private int id;
        private int onwardsAmount;
        private float payoutAmount;
        private boolean selected;

        public int getId() {
                return id;
        }

        public void setId(int id) {
                this.id = id;
        }

        public int getOnwardsAmount() {
                return onwardsAmount;
        }

        public void setOnwardsAmount(int onwardsAmount) {
                this.onwardsAmount = onwardsAmount;
        }

        public float getPayoutAmount() {
                return payoutAmount;
        }

        public void setPayoutAmount(float payoutAmount) {
                this.payoutAmount = payoutAmount;
        }

        @Override
        public int compareTo(PayoutSlab payoutSlab) {
                return this.getOnwardsAmount() - payoutSlab.getOnwardsAmount();
        }

        @Override
        public String toString() {
                return "PayoutSlab [onwardsAmount=" + onwardsAmount + ", payoutAmount=" + payoutAmount + ", selected="
                                + selected + "]";
        }

        public boolean isSelected() {
                return selected;
        }

        public void setSelected(boolean selected) {
                this.selected = selected;
        }

        @Override
        public boolean equals(Object obj) {
                if (this == obj)
                        return true;
                if (obj == null)
                        return false;
                if (getClass() != obj.getClass())
                        return false;
                PayoutSlab other = (PayoutSlab) obj;
                if (onwardsAmount != other.onwardsAmount)
                        return false;
                if (Float.floatToIntBits(payoutAmount) != Float.floatToIntBits(other.payoutAmount))
                        return false;
                return true;
        }

        @Override
        public int hashCode() {
                final int prime = 31;
                int result = 1;
                result = prime * result + onwardsAmount;
                result = prime * result + Float.floatToIntBits(payoutAmount);
                return result;
        }
}