ServiceProviderDTO.java
package com.tradecloud.dto.api.serviceprovider;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonRootName;
import com.tradecloud.dto.address.AddressDTO;
import com.tradecloud.dto.address.Addressed;
import com.tradecloud.dto.api.agent.ContactDTO;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.ArrayList;
import java.util.List;
/**
* Created by ds on 2017/12/21.
*/
@Access(AccessType.FIELD)
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "serviceProviderDTO")
@JsonRootName(value = "serviceProviderDTO")
@JsonIgnoreProperties(ignoreUnknown = true)
public class ServiceProviderDTO implements Addressed {
@NotNull
@JsonProperty(required = false)
@JsonPropertyDescription(value = "The supplier name.")
private String name;
@NotNull
@JsonProperty(required = false)
@JsonPropertyDescription(value = "The supplier code.")
private String code;
private String paymentTerm;
private String paymentMethod;
@JsonProperty
private List<AddressDTO> addresses;
@JsonProperty(required = false)
@JsonPropertyDescription(value = "The organisation code that the supplier is linked to.")
private String organisation;
@NotNull
private String estimatePaymentBasis;
private String actualPaymentBasis;
private String salesTaxRegistrationNumber;
private String companyRegistrationNumber;
private String warehouseCode;
private String vatRegistrationNumber;
private List<ContactDTO> contacts;
private List<String> type;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPaymentTerm() {
return paymentTerm;
}
public void setPaymentTerm(String paymentTerm) {
this.paymentTerm = paymentTerm;
}
public String getPaymentMethod() {
return paymentMethod;
}
public void setPaymentMethod(String paymentMethod) {
this.paymentMethod = paymentMethod;
}
public String getOrganisation() {
return organisation;
}
public void setOrganisation(String organisation) {
this.organisation = organisation;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof ServiceProviderDTO)) return false;
ServiceProviderDTO that = (ServiceProviderDTO) o;
return new EqualsBuilder()
.append(getName(), that.getName())
.append(getCode(), that.getCode())
.isEquals();
}
@Override
public int hashCode() {
return new HashCodeBuilder(17, 37)
.append(getName())
.append(getCode())
.toHashCode();
}
public List<ContactDTO> getContacts() {
if (contacts == null) {
contacts = new ArrayList<>();
}
return contacts;
}
public void setContacts(List<ContactDTO> contacts) {
this.contacts = contacts;
}
public List<AddressDTO> getAddresses() {
if (addresses == null) {
addresses = new ArrayList<>();
}
return addresses;
}
public void setAddresses(List<AddressDTO> addresses) {
this.addresses = addresses;
}
public String getActualPaymentBasis() {
return actualPaymentBasis;
}
public void setActualPaymentBasis(String actualPaymentBasis) {
this.actualPaymentBasis = actualPaymentBasis;
}
public String getSalesTaxRegistrationNumber() {
return salesTaxRegistrationNumber;
}
public void setSalesTaxRegistrationNumber(String salesTaxRegistrationNumber) {
this.salesTaxRegistrationNumber = salesTaxRegistrationNumber;
}
public String getCompanyRegistrationNumber() {
return companyRegistrationNumber;
}
public void setCompanyRegistrationNumber(String companyRegistrationNumber) {
this.companyRegistrationNumber = companyRegistrationNumber;
}
public String getWarehouseCode() {
return warehouseCode;
}
public void setWarehouseCode(String warehouseCode) {
this.warehouseCode = warehouseCode;
}
public String getVatRegistrationNumber() {
return vatRegistrationNumber;
}
public void setVatRegistrationNumber(String vatRegistrationNumber) {
this.vatRegistrationNumber = vatRegistrationNumber;
}
public String getEstimatePaymentBasis() {
return estimatePaymentBasis;
}
public void setEstimatePaymentBasis(String estimatePaymentBasis) {
this.estimatePaymentBasis = estimatePaymentBasis;
}
public List<String> getType() {
if (type == null) {
type = new ArrayList<>();
}
return type;
}
public void setType(List<String> type) {
this.type = type;
}
/* public List<BankAccountDTO> getBankAccounts() {
return bankAccounts;
}
public void setBankAccounts(List<BankAccountDTO> bankAccounts) {
this.bankAccounts = bankAccounts;
}*/
}