InvoicePaymentDTO.java

package com.tradecloud.dto.api.invoice;

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

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

@ApiModel(description = "Invoice Planned Settlement Payment dto")
public class InvoicePaymentDTO {

    @JsonProperty(required = true)
    private String shipmentReference;

    @JsonPropertyDescription(value = "invoice reference")
    @JsonProperty(required = true)
    private String reference;

    private List<PaymentDTO> paymentDTOList=new ArrayList<>();

    public String getShipmentReference() {
        return shipmentReference;
    }

    public void setShipmentReference(String shipmentReference) {
        this.shipmentReference = shipmentReference;
    }

    public String getReference() {
        return reference;
    }

    public void setReference(String reference) {
        this.reference = reference;
    }

    public List<PaymentDTO> getPaymentDTOList() {
        return paymentDTOList;
    }

    public void setPaymentDTOList(List<PaymentDTO> paymentDTOList) {
        this.paymentDTOList = paymentDTOList;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        InvoicePaymentDTO that = (InvoicePaymentDTO) o;
        return Objects.equals(shipmentReference, that.shipmentReference) &&
                Objects.equals(reference, that.reference);
    }

    @Override
    public int hashCode() {
        return Objects.hash(shipmentReference, reference);
    }
}