Skip to content

Feature Request: toString(): linefeed at the beginning #1216

@haimivan

Description

@haimivan

Hi,

is it possible to have lombok generate a linefeed/carriage return at the beginning of the toString() method. Something like:
public String toString() {
return "\nFoo(id=" + this.getId() + ", year=" + this.getYear() + ")";
}
instead of:
public String toString() {
return "Foo(id=" + this.getId() + ", year=" + this.getYear() + ")";
}

Reason:
This would make the readiblility during debugging much easier.
If I have an ArrayList of class Foo, I can see the N entries of Foo in the ArrayList in a very structured way. Each entry gets a new line. This is very convenient, if Foo has a lot of attributes.

As not every user would like to have this: perhaps it's possible to make this configurable?

Thanks for taking this into consideration!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions