String () { final StringBuilder sb = new StringBuilder("NODE#" + hashCode() + "\n"); sb.append(myPosition.toString()); sb.append("\n"); if (myExcludingGroupNumber >= 0) sb.append("in excluding group\n"); if (myAny) sb.append("any"); else if (myNothing) sb.append("nothing"); else if (!SchemaResolveState.normal.equals(myResolveState)) sb.append(myResolveState.name()); else { assert mySchema != null; sb.append("schema").append("\n"); if (mySchema.getRef() != null) sb.append("$ref: ").append(mySchema.getRef()).append("\n"); else if (!mySchema.getProperties().isEmpty()) { sb.append("properties: "); sb.append(String.join(", ", mySchema.getProperties().keySet())).append("\n"); } if (!myChildren.isEmpty()) { sb.append("OR children of NODE#").append(hashCode()).append(":\n----------------\n") .append(myChildren.stream().map(Object::toString).collect(Collectors.joining("\n"))) .append("\n=================\n"); } } return sb.toString(); }