de.adorsys.multibanking.domain.RuleEntity Maven / Gradle / Ivy
package de.adorsys.multibanking.domain;
import domain.Rule;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import java.util.ArrayList;
import java.util.List;
/**
* Created by alexg on 05.09.17.
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Document
public class RuleEntity extends Rule {
@Id
private String id;
@Indexed
private String userId;
@Indexed
private List searchIndex;
public void updateSearchIndex() {
searchIndex = new ArrayList<>();
if (getCreditorId() != null) {
searchIndex.add(getCreditorId());
}
if (getRuleId() != null) {
searchIndex.add(getRuleId());
}
if (getReceiver() != null) {
searchIndex.add(getReceiver());
}
if (getSimilarityMatchType() != null && getExpression() != null) {
searchIndex.add(getExpression());
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy