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

org.schoellerfamily.gedbrowser.persistence.mongo.domain.HasAttributes Maven / Gradle / Ivy

There is a newer version: 1.3.0-RC2
Show newest version
package org.schoellerfamily.gedbrowser.persistence.mongo.domain;

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

import org.schoellerfamily.gedbrowser.datamodel.GedObject;
import org.schoellerfamily.gedbrowser.persistence.domain.GedDocument;

/**
 * @author Dick Schoeller
 *
 * @param  the associated GedObject subclass
 */
public abstract class HasAttributes
        implements GedDocument {

    /** */
    private final List> attributes =
            new ArrayList<>();

    /**
     * {@inheritDoc}
     */
    @Override
    public final List> getAttributes() {
        return attributes;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public final void setAttributes(
            final List> attributes) {
        this.attributes.clear();
        this.attributes.addAll(attributes);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public final void addAttribute(final GedDocument attribute) {
        attributes.add(attribute);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public final void clearAttributes() {
        attributes.clear();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy