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

org.nuiton.topia.it.mapping.test1.A11Abstract Maven / Gradle / Ivy

There is a newer version: 4.0
Show newest version
package org.nuiton.topia.it.mapping.test1;

import java.util.Collection;
import java.util.LinkedList;
import javax.annotation.Generated;
import org.nuiton.topia.persistence.TopiaEntity;
import org.nuiton.topia.persistence.TopiaEntityVisitor;
import org.nuiton.topia.persistence.TopiaException;
import org.nuiton.topia.persistence.internal.AbstractTopiaEntity;
import org.nuiton.topia.persistence.util.TopiaEntityHelper;

@Generated(value = "org.nuiton.topia.templates.EntityTransformer", date = "Thu Oct 13 17:59:13 CEST 2016")
public abstract class A11Abstract extends AbstractTopiaEntity implements A11 {

    /**
     * Nom de l'attribut en BD : roleB11
     */
    protected Collection roleB11;

    private static final long serialVersionUID = 3486455938399942448L;

    @Override
    public void accept(TopiaEntityVisitor visitor) throws TopiaException {
        visitor.start(this);
        accept0(visitor);
        visitor.end(this);
    }

    protected void accept0(TopiaEntityVisitor visitor) throws TopiaException {
        visitor.visit(this, PROPERTY_ROLE_B11, Collection.class, B11.class, roleB11);
    }

    @Override
    public void addRoleB11(B11 roleB11) {
        if (this.roleB11 == null) {
            this.roleB11 = new LinkedList();
        }
        this.roleB11.add(roleB11);
    }

    @Override
    public void addAllRoleB11(Iterable roleB11) {
        if (roleB11 == null) {
            return;
        }
        for (B11 item : roleB11) {
            addRoleB11(item);
        }
    }

    @Override
    public void setRoleB11(Collection roleB11) {
        this.roleB11 = roleB11;
    }

    @Override
    public void removeRoleB11(B11 roleB11) {
        if (this.roleB11 == null || !this.roleB11.remove(roleB11)) {
            throw new IllegalArgumentException("List does not contain given element");
        }
    }

    @Override
    public void clearRoleB11() {
        if (this.roleB11 == null) {
            return;
        }
        this.roleB11.clear();
    }

    @Override
    public Collection getRoleB11() {
        return roleB11;
    }

    @Override
    public B11 getRoleB11ByTopiaId(String topiaId) {
        return TopiaEntityHelper.getEntityByTopiaId(roleB11, topiaId);
    }

    @Override
    public Collection getRoleB11TopiaIds() {
        Collection topiaIds = new LinkedList();
        Collection tmp = getRoleB11();
        if (tmp != null) {
            for (TopiaEntity topiaEntity : tmp) {
                topiaIds.add(topiaEntity.getTopiaId());
            }
        }
        return topiaIds;
    }

    @Override
    public int sizeRoleB11() {
        if (roleB11 == null) {
            return 0;
        }
        return roleB11.size();
    }

    @Override
    public boolean isRoleB11Empty() {
        int size = sizeRoleB11();
        return size == 0;
    }

    @Override
    public boolean isRoleB11NotEmpty() {
        boolean empty = isRoleB11Empty();
        return ! empty;
    }

    @Override
    public boolean containsRoleB11(B11 roleB11) {
        boolean contains = this.roleB11 !=null && this.roleB11.contains(roleB11);
        return contains;
    }

} //A11Abstract




© 2015 - 2024 Weber Informatics LLC | Privacy Policy