CostingSummarySearch.java

package com.tradecloud.domain.costing.clean;

import com.tradecloud.domain.costing.Costable;
import com.tradecloud.domain.party.ServiceProvider;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import java.io.Serializable;
import java.util.Objects;
import java.util.Set;

@Component
@Scope("view")
public class CostingSummarySearch implements Serializable {

    /**
     * UID.
     */
    private static final long serialVersionUID = 1L;

    /**
     * The entity being costed.
     */
    private Costable costable;

    private ServiceProvider freightForwarder;

    private SummaryCostType summaryCostType;

    private Set<Long> costableIdsSet;

    private Boolean primaryCosting;

    private Long costComparisonSetupId;

    @Override
    public String toString() {
        return "CostingSummarySearch [originalCostable=" + costable + "]";
    }

    public CostingSummarySearch() {
        super();
    }

    public CostingSummarySearch(Costable costable) {
        super();
        this.costable = costable;
    }

    public void setOriginalCostable(Costable originalCostable) {
        costable = originalCostable;
    }

    public Costable getOriginalCostable() {
        return costable;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CostingSummarySearch that = (CostingSummarySearch) o;
        return Objects.equals(costable, that.costable) &&
                Objects.equals(freightForwarder, that.freightForwarder) &&
                Objects.equals(costComparisonSetupId, that.costComparisonSetupId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(costable, freightForwarder);
    }

    public ServiceProvider getFreightForwarder() {
        return freightForwarder;
    }

    public void setFreightForwarder(ServiceProvider freightForwarder) {
        this.freightForwarder = freightForwarder;
    }

    public SummaryCostType getSummaryCostType() {
        return summaryCostType;
    }

    public void setSummaryCostType(SummaryCostType summaryCostType) {
        this.summaryCostType = summaryCostType;
    }

    public Set<Long> getCostableIdsSet() {
        return costableIdsSet;
    }

    public void setCostableIdsSet(Set<Long> costableIdsSet) {
        this.costableIdsSet = costableIdsSet;
    }

    public Boolean isPrimaryCosting() {
        return primaryCosting;
    }

    public void setPrimaryCosting(Boolean primaryCosting) {
        this.primaryCosting = primaryCosting;
    }

    public Boolean getPrimaryCosting() {
        return primaryCosting;
    }

    public Long getCostComparisonSetupId() {
        return costComparisonSetupId;
    }

    public void setCostComparisonSetupId(Long costComparisonSetupId) {
        this.costComparisonSetupId = costComparisonSetupId;
    }
}