io.swagger.client.model.KeywordRule 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;
import java.util.ArrayList;
import java.util.List;
/**
* Container for a keyword rule
*/
@ApiModel(description = "Container for a keyword rule")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2019-02-05T12:19:21.458Z")
public class KeywordRule {
@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("keywords")
private List keywords = new ArrayList();
public KeywordRule 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 KeywordRule 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 KeywordRule 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 = "Spending", 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 KeywordRule 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 KeywordRule keywords(List keywords) {
this.keywords = keywords;
return this;
}
public KeywordRule addKeywordsItem(String keywordsItem) {
this.keywords.add(keywordsItem);
return this;
}
/**
* Set of keywords that this rule defines.
* @return keywords
**/
@ApiModelProperty(example = "[\"coffee\",\"pizza\",\"burger\"]", required = true, value = "Set of keywords that this rule defines.")
public List getKeywords() {
return keywords;
}
public void setKeywords(List keywords) {
this.keywords = keywords;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
KeywordRule keywordRule = (KeywordRule) o;
return Objects.equals(this.id, keywordRule.id) &&
Objects.equals(this.category, keywordRule.category) &&
Objects.equals(this.direction, keywordRule.direction) &&
Objects.equals(this.creationDate, keywordRule.creationDate) &&
Objects.equals(this.keywords, keywordRule.keywords);
}
@Override
public int hashCode() {
return Objects.hash(id, category, direction, creationDate, keywords);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class KeywordRule {\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(" keywords: ").append(toIndentedString(keywords)).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 ");
}
}