Rev 35600 | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed
package com.spice.profitmandi.dao.model;import com.fasterxml.jackson.annotation.JsonIgnoreProperties;import java.util.List;import java.util.Objects;@JsonIgnoreProperties(ignoreUnknown = true)public class TargetSlab implements Comparable<TargetSlab>, java.io.Serializable {private static final long serialVersionUID = 1L;private int onwardsAmount;private String targetDescription;private List<ItemCriteriaPayout> itemCriteriaPayouts;public int getOnwardsAmount() {return onwardsAmount;}public int getRemainingAmount(int eligibleSale) {return onwardsAmount - eligibleSale;}public void setOnwardsAmount(int onwardsAmount) {this.onwardsAmount = onwardsAmount;}public boolean validate() {return this.itemCriteriaPayouts!= null;}public List<ItemCriteriaPayout> getItemCriteriaPayouts() {return itemCriteriaPayouts;}public void setItemCriteriaPayouts(List<ItemCriteriaPayout> itemCriteriaPayouts) {this.itemCriteriaPayouts = itemCriteriaPayouts;}@Overridepublic int compareTo(TargetSlab targetSlab) {if(this.getOnwardsAmount() - targetSlab.getOnwardsAmount() > 0) {return 1;}else {return -1;}}@Overridepublic boolean equals(Object obj) {if (this == obj)return true;if (obj == null)return false;if (getClass() != obj.getClass())return false;TargetSlab other = (TargetSlab) obj;if (itemCriteriaPayouts == null) {if (other.itemCriteriaPayouts != null)return false;} else if (!itemCriteriaPayouts.equals(other.itemCriteriaPayouts))return false;if (onwardsAmount != other.onwardsAmount)return false;if (targetDescription == null) {if (other.targetDescription != null)return false;} else if (!targetDescription.equals(other.targetDescription))return false;return true;}@Overridepublic int hashCode() {final int prime = 31;int result = 1;result = prime * result + ((itemCriteriaPayouts == null) ? 0 : itemCriteriaPayouts.hashCode());result = prime * result + onwardsAmount;result = prime * result + ((targetDescription == null) ? 0 : targetDescription.hashCode());return result;}@Overridepublic String toString() {return "TargetSlab [onwardsAmount=" + onwardsAmount + ", targetDescription=" + targetDescription+ ", itemCriteriaPayouts=" + itemCriteriaPayouts + "]";}public String getTargetDescription() {return targetDescription;}public void setTargetDescription(String targetDescription) {this.targetDescription = targetDescription;}}