All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.adorsys.multibanking.domain.BookingsIndexEntity Maven / Gradle / Ivy

There is a newer version: 5.5.43
Show newest version
package de.adorsys.multibanking.domain;

import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.util.*;

@Data
public class BookingsIndexEntity {

    private String id;
    private String accountId;
    private String userId;

    private Map> bookingIdSearchList;

    public void updateSearchIndex(List bookings) {
        bookingIdSearchList = new HashMap<>();
        new LinkedList<>(bookings)
            .descendingIterator()
            .forEachRemaining(booking -> {
                List search = new ArrayList<>();
                if (booking.getBookingCategory() != null) {
                    if (StringUtils.isNotBlank(booking.getBookingCategory().getReceiver())) {
                        search.add(booking.getBookingCategory().getReceiver());
                    }
                }
                if (booking.getOtherAccount() != null) {
                    if (StringUtils.isNotBlank(booking.getOtherAccount().getName())) {
                        search.add(booking.getOtherAccount().getName());
                    }
                    if (StringUtils.isNotBlank(booking.getOtherAccount().getOwner())) {
                        search.add(booking.getOtherAccount().getOwner());
                    }
                }
                bookingIdSearchList.put(booking.getId(), search);
            });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy