com.sagframe.sagacity.sqltoy.plus.ISqlAssemble Maven / Gradle / Ivy
The newest version!
package com.sagframe.sagacity.sqltoy.plus;
import java.util.ArrayList;
import java.util.List;
public abstract class ISqlAssemble> {
private boolean isAssemble;
private List assemblers;
public ISqlAssemble() {
this.assemblers = new ArrayList<>();
}
public void add(E assembler) {
assemblers.add(assembler);
}
public boolean isEmpty() {
return assemblers == null || assemblers.isEmpty();
}
public void assemble(T mappingStrategy) {
if (isAssemble) {
return;
}
if (isEmpty()) {
return;
}
for (E sqlAssembler : assemblers) {
sqlAssembler.assemble(mappingStrategy);
}
isAssemble = true;
}
}