FilterNode、FilterJoinNode增加copy方法
This commit is contained in:
@@ -82,6 +82,18 @@ public class FilterJoinNode extends FilterNode {
|
||||
return new FilterJoinNode(joinClass, joinColumns, column, express, itemand, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FilterJoinNode copy() {
|
||||
FilterJoinNode node = (FilterJoinNode) copy(new FilterJoinNode());
|
||||
node.joinClass = this.joinClass;
|
||||
node.joinEntity = this.joinEntity;
|
||||
if (this.joinColumns != null) {
|
||||
node.joinColumns = new String[this.joinColumns.length];
|
||||
System.arraycopy(this.joinColumns, 0, node.joinColumns, 0, this.joinColumns.length);
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected FilterNode any(final FilterNode node0, boolean signor) {
|
||||
Objects.requireNonNull(node0);
|
||||
|
||||
@@ -82,6 +82,26 @@ public class FilterNode { //FilterNode 不能实现Serializable接口, 否则
|
||||
this.value = val;
|
||||
}
|
||||
|
||||
public FilterNode copy() {
|
||||
return copy(new FilterNode());
|
||||
}
|
||||
|
||||
protected FilterNode copy(FilterNode node) {
|
||||
node.readOnly = this.readOnly;
|
||||
node.column = this.column;
|
||||
node.express = this.express;
|
||||
node.value = this.value;
|
||||
node.itemand = this.itemand;
|
||||
node.or = this.or;
|
||||
if (this.nodes != null) {
|
||||
node.nodes = new FilterNode[this.nodes.length];
|
||||
for (int i = 0; i < node.nodes.length; i++) {
|
||||
node.nodes[i] = this.nodes[i] == null ? null : this.nodes[i].copy();
|
||||
}
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
public FilterNode asReadOnly() {
|
||||
this.readOnly = true;
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user