Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

to-string-formatter-java

Idea on how to format the output of ToStringBuilder.

Groovy code:

def out = ''
def indent = 0
text.split('').each {
    if (it == ',') {
        out += it + '\n' + ('\t'*indent)
    }
    else if (it == '[') {
        indent++
        out += it + '\n' + ('\t'*indent)
    }
    else if (it == ']') {
        indent--
        out += it + '\n' + ('\t'*indent)
    }
    else {
        out += it
    }
}
return out

About

Format output of ToStringBuilder.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors