org.nuiton.topia.it.mapping.test6.A63Abstract Maven / Gradle / Ivy
package org.nuiton.topia.it.mapping.test6;
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 A63Abstract extends AbstractTopiaEntity implements A63 {
/**
* Nom de l'attribut en BD : roleB63
*/
protected List roleB63;
private static final long serialVersionUID = 7364573104786662969L;
@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_B63, List.class, B63.class, roleB63);
}
@Override
public void addRoleB63(B63 roleB63) {
fireOnPreWrite(PROPERTY_ROLE_B63, null, roleB63);
if (this.roleB63 == null) {
this.roleB63 = new LinkedList();
}
this.roleB63.add(roleB63);
fireOnPostWrite(PROPERTY_ROLE_B63, this.roleB63.size(), null, roleB63);
}
@Override
public void addRoleB63(int index, B63 roleB63) {
fireOnPreWrite(PROPERTY_ROLE_B63, null, roleB63);
if (this.roleB63 == null) {
this.roleB63 = new LinkedList();
}
this.roleB63.add(index, roleB63);
fireOnPostWrite(PROPERTY_ROLE_B63, index, null, roleB63);
}
@Override
public void addAllRoleB63(Iterable roleB63) {
if (roleB63 == null) {
return;
}
for (B63 item : roleB63) {
addRoleB63(item);
}
}
@Override
public void setRoleB63(List roleB63) {
// Copy elements to keep data for fire with new reference
List oldValue = this.roleB63 != null ? new LinkedList(this.roleB63) : null;
fireOnPreWrite(PROPERTY_ROLE_B63, oldValue, roleB63);
this.roleB63 = roleB63;
fireOnPostWrite(PROPERTY_ROLE_B63, oldValue, roleB63);
}
@Override
public void removeRoleB63(B63 roleB63) {
fireOnPreWrite(PROPERTY_ROLE_B63, roleB63, null);
if (this.roleB63 == null || !this.roleB63.remove(roleB63)) {
throw new IllegalArgumentException("List does not contain given element");
}
fireOnPostWrite(PROPERTY_ROLE_B63, this.roleB63.size() + 1, roleB63, null);
}
@Override
public void removeRoleB63(int index) {
fireOnPreWrite(PROPERTY_ROLE_B63, roleB63, null);
if (this.roleB63 == null) {
throw new IllegalArgumentException("List does not contain given element");
}
B63 oldValue = this.roleB63.remove(index);
if (oldValue == null) {
throw new IllegalArgumentException("List does not contain given element");
}
fireOnPostWrite(PROPERTY_ROLE_B63, index, oldValue, null);
}
@Override
public void clearRoleB63() {
if (this.roleB63 == null) {
return;
}
List oldValue = new LinkedList(this.roleB63);
fireOnPreWrite(PROPERTY_ROLE_B63, oldValue, this.roleB63);
this.roleB63.clear();
fireOnPostWrite(PROPERTY_ROLE_B63, oldValue, this.roleB63);
}
@Override
public List getRoleB63() {
return roleB63;
}
@Override
public B63 getRoleB63(int index) {
return TopiaEntityHelper.getEntityByIndex(roleB63, index);
}
@Override
public B63 getRoleB63ByTopiaId(String topiaId) {
return TopiaEntityHelper.getEntityByTopiaId(roleB63, topiaId);
}
@Override
public List getRoleB63TopiaIds() {
List topiaIds = new LinkedList();
List tmp = getRoleB63();
if (tmp != null) {
for (TopiaEntity topiaEntity : tmp) {
topiaIds.add(topiaEntity.getTopiaId());
}
}
return topiaIds;
}
@Override
public int sizeRoleB63() {
if (roleB63 == null) {
return 0;
}
return roleB63.size();
}
@Override
public boolean isRoleB63Empty() {
int size = sizeRoleB63();
return size == 0;
}
@Override
public boolean isRoleB63NotEmpty() {
boolean empty = isRoleB63Empty();
return ! empty;
}
@Override
public boolean containsRoleB63(B63 roleB63) {
boolean contains = this.roleB63 !=null && this.roleB63.contains(roleB63);
return contains;
}
} //A63Abstract
© 2015 - 2024 Weber Informatics LLC | Privacy Policy