mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
CE-882 Better(?) toString
This commit is contained in:
@ -361,23 +361,44 @@ public class QQueryFilter implements Serializable, Cloneable
|
|||||||
StringBuilder rs = new StringBuilder("(");
|
StringBuilder rs = new StringBuilder("(");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
int criteriaIndex = 0;
|
||||||
for(QFilterCriteria criterion : CollectionUtils.nonNullList(criteria))
|
for(QFilterCriteria criterion : CollectionUtils.nonNullList(criteria))
|
||||||
{
|
{
|
||||||
rs.append(criterion).append(" ").append(getBooleanOperator()).append(" ");
|
if(criteriaIndex > 0)
|
||||||
|
{
|
||||||
|
rs.append(" ").append(getBooleanOperator()).append(" ");
|
||||||
|
}
|
||||||
|
rs.append(criterion);
|
||||||
|
criteriaIndex++;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(QQueryFilter subFilter : CollectionUtils.nonNullList(subFilters))
|
if(CollectionUtils.nullSafeHasContents(subFilters))
|
||||||
{
|
{
|
||||||
rs.append(subFilter);
|
rs.append("Sub:{");
|
||||||
|
int subIndex = 0;
|
||||||
|
for(QQueryFilter subFilter : CollectionUtils.nonNullList(subFilters))
|
||||||
|
{
|
||||||
|
if(subIndex > 0)
|
||||||
|
{
|
||||||
|
rs.append(" ").append(getBooleanOperator()).append(" ");
|
||||||
|
}
|
||||||
|
rs.append(subFilter);
|
||||||
|
subIndex++;
|
||||||
|
}
|
||||||
|
rs.append("}");
|
||||||
}
|
}
|
||||||
|
|
||||||
rs.append(")");
|
rs.append(")");
|
||||||
|
|
||||||
rs.append("OrderBy[");
|
if(CollectionUtils.nullSafeHasContents(orderBys))
|
||||||
for(QFilterOrderBy orderBy : CollectionUtils.nonNullList(orderBys))
|
|
||||||
{
|
{
|
||||||
rs.append(orderBy).append(",");
|
rs.append("OrderBy[");
|
||||||
|
for(QFilterOrderBy orderBy : CollectionUtils.nonNullList(orderBys))
|
||||||
|
{
|
||||||
|
rs.append(orderBy).append(",");
|
||||||
|
}
|
||||||
|
rs.append("]");
|
||||||
}
|
}
|
||||||
rs.append("]");
|
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user