
org.nuiton.topia.it.mapping.test14.A14DAbstract Maven / Gradle / Ivy
The newest version!
package org.nuiton.topia.it.mapping.test14;
/*-
* #%L
* ToPIA :: IT
* %%
* Copyright (C) 2004 - 2024 Code Lutin
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* .
* #L%
*/
import java.util.Collection;
import java.util.LinkedList;
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;
public abstract class A14DAbstract extends AbstractTopiaEntity implements A14D {
/**
* Nom de l'attribut en BD : b14D
*/
protected Collection b14DAssoc14D;
private static final long serialVersionUID = 3559593450472027491L;
@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_B14_DASSOC14_D, Collection.class, Assoc14D.class, b14DAssoc14D);
}
@Override
public void addB14DAssoc14D(Assoc14D b14DAssoc14D) {
if (this.b14DAssoc14D == null) {
this.b14DAssoc14D = new LinkedList();
}
this.b14DAssoc14D.add(b14DAssoc14D);
}
@Override
public void addAllB14DAssoc14D(Iterable b14DAssoc14D) {
if (b14DAssoc14D == null) {
return;
}
for (Assoc14D item : b14DAssoc14D) {
addB14DAssoc14D(item);
}
}
@Override
public void setB14DAssoc14D(Collection b14DAssoc14D) {
this.b14DAssoc14D = b14DAssoc14D;
}
@Override
public void removeB14DAssoc14D(Assoc14D b14DAssoc14D) {
if (this.b14DAssoc14D == null || !this.b14DAssoc14D.remove(b14DAssoc14D)) {
throw new IllegalArgumentException("List does not contain given element");
}
}
@Override
public void clearB14DAssoc14D() {
if (this.b14DAssoc14D == null) {
return;
}
for (Assoc14D item : this.b14DAssoc14D) {
}
this.b14DAssoc14D.clear();
}
@Override
public Collection getB14DAssoc14D() {
return b14DAssoc14D;
}
@Override
public Assoc14D getB14DAssoc14DByTopiaId(String topiaId) {
return TopiaEntityHelper.getEntityByTopiaId(b14DAssoc14D, topiaId);
}
@Override
public Collection getB14DAssoc14DTopiaIds() {
Collection topiaIds = new LinkedList();
Collection tmp = getB14DAssoc14D();
if (tmp != null) {
for (TopiaEntity topiaEntity : tmp) {
topiaIds.add(topiaEntity.getTopiaId());
}
}
return topiaIds;
}
@Override
public int sizeB14DAssoc14D() {
if (b14DAssoc14D == null) {
return 0;
}
return b14DAssoc14D.size();
}
@Override
public boolean isB14DAssoc14DEmpty() {
int size = sizeB14DAssoc14D();
return size == 0;
}
@Override
public boolean isB14DAssoc14DNotEmpty() {
boolean empty = isB14DAssoc14DEmpty();
return ! empty;
}
@Override
public boolean containsB14DAssoc14D(Assoc14D b14DAssoc14D) {
boolean contains = this.b14DAssoc14D !=null && this.b14DAssoc14D.contains(b14DAssoc14D);
return contains;
}
} //A14DAbstract
© 2015 - 2025 Weber Informatics LLC | Privacy Policy