uk.org.openbanking.datamodel.payment.OBExchangeRate2 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openbanking-sdk Show documentation
Show all versions of openbanking-sdk Show documentation
A Java SDK to help implementing the Open Banking standard : https://www.openbanking.org.uk/read-write-apis/
/**
*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at https://forgerock.org/cddlv1-0/. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2019 ForgeRock AS.
*/
package uk.org.openbanking.datamodel.payment;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.joda.time.DateTime;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.util.Objects;
/**
* Further detailed information on the exchange rate that has been used in the payment transaction.
*/
@ApiModel(description = "Further detailed information on the exchange rate that has been used in the payment transaction.")
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2018-10-10T14:05:22.993+01:00")
public class OBExchangeRate2 {
@JsonProperty("UnitCurrency")
private String unitCurrency = null;
@JsonProperty("ExchangeRate")
private BigDecimal exchangeRate = null;
@JsonProperty("RateType")
private OBExchangeRateType2Code rateType = null;
@JsonProperty("ContractIdentification")
private String contractIdentification = null;
@JsonProperty("ExpirationDateTime")
private DateTime expirationDateTime = null;
public OBExchangeRate2 unitCurrency(String unitCurrency) {
this.unitCurrency = unitCurrency;
return this;
}
/**
* Currency in which the rate of exchange is expressed in a currency exchange. In the example 1GBP = xxxCUR, the unit currency is GBP.
* @return unitCurrency
**/
@ApiModelProperty(required = true, value = "Currency in which the rate of exchange is expressed in a currency exchange. In the example 1GBP = xxxCUR, the unit currency is GBP.")
@NotNull
@Pattern(regexp="^[A-Z]{3,3}$")
public String getUnitCurrency() {
return unitCurrency;
}
public void setUnitCurrency(String unitCurrency) {
this.unitCurrency = unitCurrency;
}
public OBExchangeRate2 exchangeRate(BigDecimal exchangeRate) {
this.exchangeRate = exchangeRate;
return this;
}
/**
* The factor used for conversion of an amount from one currency to another. This reflects the price at which one currency was bought with another currency.
* @return exchangeRate
**/
@ApiModelProperty(required = true, value = "The factor used for conversion of an amount from one currency to another. This reflects the price at which one currency was bought with another currency.")
@NotNull
@Valid
public BigDecimal getExchangeRate() {
return exchangeRate;
}
public void setExchangeRate(BigDecimal exchangeRate) {
this.exchangeRate = exchangeRate;
}
public OBExchangeRate2 rateType(OBExchangeRateType2Code rateType) {
this.rateType = rateType;
return this;
}
/**
* Get rateType
* @return rateType
**/
@ApiModelProperty(required = true, value = "")
@NotNull
@Valid
public OBExchangeRateType2Code getRateType() {
return rateType;
}
public void setRateType(OBExchangeRateType2Code rateType) {
this.rateType = rateType;
}
public OBExchangeRate2 contractIdentification(String contractIdentification) {
this.contractIdentification = contractIdentification;
return this;
}
/**
* Unique and unambiguous reference to the foreign exchange contract agreed between the initiating party/creditor and the debtor agent.
* @return contractIdentification
**/
@ApiModelProperty(value = "Unique and unambiguous reference to the foreign exchange contract agreed between the initiating party/creditor and the debtor agent.")
@Size(min=1,max=256)
public String getContractIdentification() {
return contractIdentification;
}
public void setContractIdentification(String contractIdentification) {
this.contractIdentification = contractIdentification;
}
public OBExchangeRate2 expirationDateTime(DateTime expirationDateTime) {
this.expirationDateTime = expirationDateTime;
return this;
}
/**
* Specified date and time the exchange rate agreement will expire. All dates in the JSON payloads are represented in ISO 8601 date-time format. All date-time fields in responses must include the timezone. An example is below: 2017-04-05T10:43:07+00:00
* @return expirationDateTime
**/
@ApiModelProperty(value = "Specified date and time the exchange rate agreement will expire. All dates in the JSON payloads are represented in ISO 8601 date-time format. All date-time fields in responses must include the timezone. An example is below: 2017-04-05T10:43:07+00:00")
@Valid
public DateTime getExpirationDateTime() {
return expirationDateTime;
}
public void setExpirationDateTime(DateTime expirationDateTime) {
this.expirationDateTime = expirationDateTime;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
OBExchangeRate2 obExchangeRate2 = (OBExchangeRate2) o;
return Objects.equals(this.unitCurrency, obExchangeRate2.unitCurrency) &&
Objects.equals(this.exchangeRate, obExchangeRate2.exchangeRate) &&
Objects.equals(this.rateType, obExchangeRate2.rateType) &&
Objects.equals(this.contractIdentification, obExchangeRate2.contractIdentification) &&
Objects.equals(this.expirationDateTime, obExchangeRate2.expirationDateTime);
}
@Override
public int hashCode() {
return Objects.hash(unitCurrency, exchangeRate, rateType, contractIdentification, expirationDateTime);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class OBExchangeRate2 {\n");
sb.append(" unitCurrency: ").append(toIndentedString(unitCurrency)).append("\n");
sb.append(" exchangeRate: ").append(toIndentedString(exchangeRate)).append("\n");
sb.append(" rateType: ").append(toIndentedString(rateType)).append("\n");
sb.append(" contractIdentification: ").append(toIndentedString(contractIdentification)).append("\n");
sb.append(" expirationDateTime: ").append(toIndentedString(expirationDateTime)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}