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

org.kapott.hbci.GV.parsers.AbstractCamtParser Maven / Gradle / Ivy

Go to download

HBCI4j - Home Banking Computer Interface for Java - Clone from https://github.com/hbci4j/hbci4java

There is a newer version: 3.5.46
Show newest version
/**********************************************************************
 *
 * Copyright (c) 2018 Olaf Willuhn
 * All rights reserved.
 *
 * This software is copyrighted work licensed under the terms of the
 * Jameica License.  Please consult the file "LICENSE" for details. 
 *
 **********************************************************************/

package org.kapott.hbci.GV.parsers;

import org.kapott.hbci.GV_Result.GVRKUms.BTag;

import java.util.ArrayList;
import java.util.List;

/**
 * Abstrakte Basis-Implementierung der CAMT-Parser.
 */
public abstract class AbstractCamtParser implements ISEPAParser> {
    /**
     * Entfernt die Whitespaces des Textes.
     * Manche Banken fuellen den Gegenkontoinhaber rechts auf 70 Zeichen mit Leerzeichen auf.
     *
     * @param s der Text. NPE-Sicher.
     * @return der getrimmte Text.
     */
    protected String trim(String s) {
        if (s == null || s.length() == 0)
            return s;

        return s.trim();
    }

    /**
     * Entfernt die Whitespaces in der Liste der Texte.
     *
     * @param list Liste der Texte. NPE-Sicher. Leere Zeilen werden uebersprungen.
     * @return die getrimmte Liste.
     */
    protected List trim(List list) {
        if (list == null || list.isEmpty())
            return list;

        List result = new ArrayList<>();
        for (String s : list) {
            s = trim(s);

            if (s == null || s.length() == 0)
                continue;

            result.add(s);
        }

        return result;
    }

}






© 2015 - 2024 Weber Informatics LLC | Privacy Policy