Skip to content

Instantly share code, notes, and snippets.

@sandipchitale
Last active July 29, 2023 15:06
Show Gist options
  • Save sandipchitale/39355527688a35048daf6f32e713b017 to your computer and use it in GitHub Desktop.
Save sandipchitale/39355527688a35048daf6f32e713b017 to your computer and use it in GitHub Desktop.
Generate tree rows with emojis #tree
System.out.println(genIndent(0, "\uD83C\uDFD8\uFE0F") + " Contexts");
System.out.println(genIndent(1, "\uD83C\uDFE0") + " Context: " + contextName);
System.out.println(genIndent(2, "βœ…") + " Positive Matches: ");
System.out.println(genIndent(2, "β›”") + " Negative Matches (at least one did not match): " + contextName);
System.out.println(genIndent(3, "\uD83D\uDC4D") + " Condition Name: " + conditionName);
System.out.println(genIndent(4, " \uD83D\uDEC8") + " Message: " + messageAndConditionDescriptor.getMessage());
🏘️ Contexts
β””β”€πŸ  Context: application
β”‚ β””β”€βœ… Positive Matches:
β”‚ β”‚ β””β”€πŸ‘ Condition Name: AuditEventsEndpointAutoConfiguration
β”‚ β”‚ β”‚ β””β”€βœ… Matched Condition: OnAvailableEndpointCondition
β”‚ β”‚ β”‚ └─ πŸ›ˆ Message: @ConditionalOnAvailableEndpoint marked as exposed by a 'management.endpoints.jmx.exposure' property
private static String genIndent(int indent, String icon) {
if (indent == 0) {
return icon;
}
StringBuilder sb = new StringBuilder(" ");
for (int i = 0; i < (indent - 1); i++) {
sb.append("β”‚ ");
}
sb.append("└─");
sb.append(icon);
return sb.toString();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment