CostGroupSummaryDTO.java

package com.tradecloud.dto.api;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import io.swagger.annotations.ApiModel;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

@ApiModel(description = CommonAPIMessage.IGNORE_READ_ONLY_FIELDS)
public class CostGroupSummaryDTO {
    @JsonProperty(required = true)
    private String name;
    @JsonProperty(access = JsonProperty.Access.AUTO)
    private BigDecimal total;
    @JsonProperty(access = JsonProperty.Access.AUTO)
    private String currency;
    @JsonProperty(value="costLineSummaryDTOList",required = true)
    @JsonPropertyDescription(value = "You may choose to send only overridden costlines")
    private List<CostLineSummaryDTO> costLineSummaryDTOList;

    private List<CurrencyExchangeRateDTO> currencyExchangeRateDTOS=new ArrayList<>();

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public BigDecimal getTotal() {
        if (total == null) {
            total = BigDecimal.ZERO;
        }
        return total;
    }

    public void setTotal(BigDecimal total) {
        this.total = total;
    }

    public String getCurrency() {
        return currency;
    }

    public void setCurrency(String currency) {
        this.currency = currency;
    }

    public List<CostLineSummaryDTO> getCostLineSummaryDTOList() {
        if (costLineSummaryDTOList == null) {
            costLineSummaryDTOList = new ArrayList<>();
        }
        return costLineSummaryDTOList;
    }

    public void setCostLineSummaryDTOList(List<CostLineSummaryDTO> costLineSummaryDTOList) {
        this.costLineSummaryDTOList = costLineSummaryDTOList;
    }

    public List<CurrencyExchangeRateDTO> getCurrencyExchangeRateDTOS() {
        return currencyExchangeRateDTOS;
    }

    public void setCurrencyExchangeRateDTOS(List<CurrencyExchangeRateDTO> currencyExchangeRateDTOS) {
        this.currencyExchangeRateDTOS = currencyExchangeRateDTOS;
    }
}