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

org.schoellerfamily.gedbrowser.api.transformers.SourceTitleBuilder 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.AttributeDocument;
import org.schoellerfamily.gedbrowser.persistence.domain.GedDocument;
import org.schoellerfamily.gedbrowser.persistence.domain.SourceDocument;

/**
 * @author Dick Schoeller
 */
public interface SourceTitleBuilder {
    /**
     * @param document the document whose title we want
     * @return the title
     */
    default String title(final SourceDocument document) {
        for (final GedDocument g : document.getAttributes()) {
            if ("Title".equals(g.getString())) {
                final AttributeDocument a = (AttributeDocument) g;
                return a.getTail();
            }
        }
        return "Unknown";
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy