io.swagger.client.model.IbanRule Maven / Gradle / Ivy
/*
* finAPI RESTful Services
* finAPI RESTful Services
*
* OpenAPI spec version: v1.64.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package io.swagger.client.model;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.client.model.Category;
import java.io.IOException;
/**
* Container for an IBAN rule
*/
@ApiModel(description = "Container for an IBAN rule")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2019-02-05T12:19:21.458Z")
public class IbanRule {
@SerializedName("id")
private Long id = null;
@SerializedName("category")
private Category category = null;
/**
* Direction for the rule. 'Income' means that the rule applies to transactions with a positive amount only, 'Spending' means it applies to transactions with a negative amount only.
*/
@JsonAdapter(DirectionEnum.Adapter.class)
public enum DirectionEnum {
INCOME("Income"),
SPENDING("Spending");
private String value;
DirectionEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static DirectionEnum fromValue(String text) {
for (DirectionEnum b : DirectionEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final DirectionEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public DirectionEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return DirectionEnum.fromValue(String.valueOf(value));
}
}
}
@SerializedName("direction")
private DirectionEnum direction = null;
@SerializedName("creationDate")
private String creationDate = null;
@SerializedName("iban")
private String iban = null;
public IbanRule id(Long id) {
this.id = id;
return this;
}
/**
* Rule identifier
* @return id
**/
@ApiModelProperty(example = "1", required = true, value = "Rule identifier")
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public IbanRule category(Category category) {
this.category = category;
return this;
}
/**
* The category that this rule assigns to the transactions that it matches
* @return category
**/
@ApiModelProperty(required = true, value = "The category that this rule assigns to the transactions that it matches")
public Category getCategory() {
return category;
}
public void setCategory(Category category) {
this.category = category;
}
public IbanRule direction(DirectionEnum direction) {
this.direction = direction;
return this;
}
/**
* Direction for the rule. 'Income' means that the rule applies to transactions with a positive amount only, 'Spending' means it applies to transactions with a negative amount only.
* @return direction
**/
@ApiModelProperty(example = "Income", required = true, value = "Direction for the rule. 'Income' means that the rule applies to transactions with a positive amount only, 'Spending' means it applies to transactions with a negative amount only.")
public DirectionEnum getDirection() {
return direction;
}
public void setDirection(DirectionEnum direction) {
this.direction = direction;
}
public IbanRule creationDate(String creationDate) {
this.creationDate = creationDate;
return this;
}
/**
* Timestamp of when the rule was created, in the format 'YYYY-MM-DD HH:MM:SS.SSS' (german time)
* @return creationDate
**/
@ApiModelProperty(example = "2018-01-01 00:00:00.000", required = true, value = "Timestamp of when the rule was created, in the format 'YYYY-MM-DD HH:MM:SS.SSS' (german time)")
public String getCreationDate() {
return creationDate;
}
public void setCreationDate(String creationDate) {
this.creationDate = creationDate;
}
public IbanRule iban(String iban) {
this.iban = iban;
return this;
}
/**
* The IBAN for this rule
* @return iban
**/
@ApiModelProperty(example = "DE89370400440532013000", required = true, value = "The IBAN for this rule")
public String getIban() {
return iban;
}
public void setIban(String iban) {
this.iban = iban;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
IbanRule ibanRule = (IbanRule) o;
return Objects.equals(this.id, ibanRule.id) &&
Objects.equals(this.category, ibanRule.category) &&
Objects.equals(this.direction, ibanRule.direction) &&
Objects.equals(this.creationDate, ibanRule.creationDate) &&
Objects.equals(this.iban, ibanRule.iban);
}
@Override
public int hashCode() {
return Objects.hash(id, category, direction, creationDate, iban);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class IbanRule {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" category: ").append(toIndentedString(category)).append("\n");
sb.append(" direction: ").append(toIndentedString(direction)).append("\n");
sb.append(" creationDate: ").append(toIndentedString(creationDate)).append("\n");
sb.append(" iban: ").append(toIndentedString(iban)).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(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}