[android] - add toString to Expression to print out object array notation

This commit is contained in:
Tobrun
2018-01-24 13:36:50 +01:00
committed by Tobrun
parent 37e47e2f10
commit 5dbc20dc75
2 changed files with 41 additions and 0 deletions

View File

@@ -1776,4 +1776,22 @@ public class Expression<T> {
return output;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("[\"").append(operator).append("\"");
if (arguments != null) {
for (Expression argument : arguments) {
builder.append(", ");
if (argument instanceof ExpressionLiteral) {
builder.append(((ExpressionLiteral) argument).toValue());
} else {
builder.append(argument.toString());
}
}
}
builder.append("]");
return builder.toString();
}
}