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

org.nuiton.topia.it.mapping.test7.A72Abstract Maven / Gradle / Ivy

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

import java.util.LinkedList;
import java.util.List;
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 A72Abstract extends AbstractTopiaEntity implements A72 {

    /**
     * Nom de l'attribut en BD : roleB72
     */
    protected List roleB72;

    private static final long serialVersionUID = 3977916947125069110L;

    @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_B72, List.class, B72.class, roleB72);
    }

    @Override
    public void addRoleB72(B72 roleB72) {
        if (this.roleB72 == null) {
            this.roleB72 = new LinkedList();
        }
        this.roleB72.add(roleB72);
    }

    @Override
    public void addRoleB72(int index, B72 roleB72) {
        if (this.roleB72 == null) {
            this.roleB72 = new LinkedList();
        }
        this.roleB72.add(index, roleB72);
    }

    @Override
    public void addAllRoleB72(Iterable roleB72) {
        if (roleB72 == null) {
            return;
        }
        for (B72 item : roleB72) {
            addRoleB72(item);
        }
    }

    @Override
    public void setRoleB72(List roleB72) {
        this.roleB72 = roleB72;
    }

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

    @Override
    public void removeRoleB72(int index) {
        if (this.roleB72 == null) {
            throw new IllegalArgumentException("List does not contain given element");
        }
        B72 oldValue = this.roleB72.remove(index);
        if (oldValue == null) {
            throw new IllegalArgumentException("List does not contain given element");
        }
    }

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

    @Override
    public List getRoleB72() {
        return roleB72;
    }

    @Override
    public B72 getRoleB72(int index) {
        return TopiaEntityHelper.getEntityByIndex(roleB72, index);
    }

    @Override
    public B72 getRoleB72ByTopiaId(String topiaId) {
        return TopiaEntityHelper.getEntityByTopiaId(roleB72, topiaId);
    }

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

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

    @Override
    public boolean isRoleB72Empty() {
        int size = sizeRoleB72();
        return size == 0;
    }

    @Override
    public boolean isRoleB72NotEmpty() {
        boolean empty = isRoleB72Empty();
        return ! empty;
    }

    @Override
    public boolean containsRoleB72(B72 roleB72) {
        boolean contains = this.roleB72 !=null && this.roleB72.contains(roleB72);
        return contains;
    }

} //A72Abstract




© 2015 - 2024 Weber Informatics LLC | Privacy Policy