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

org.schoellerfamily.gedbrowser.api.transformers.SubmitterNameBuilder Maven / Gradle / Ivy

There is a newer version: 1.3.0-RC2
Show newest version
package org.schoellerfamily.gedbrowser.api.transformers;

import org.schoellerfamily.gedbrowser.persistence.domain.GedDocument;
import org.schoellerfamily.gedbrowser.persistence.domain.SubmitterDocument;

/**
 * @author Dick Schoeller
 */
public interface SubmitterNameBuilder {
    /**
     * @param document the document whose name we want
     * @return the name
     */
    default String name(final SubmitterDocument document) {
        for (final GedDocument g : document.getAttributes()) {
            if ("name".equals(g.getType())) {
                return g.getString().replace("/", " ").trim();
            }
        }
        return "? ?";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy