Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[W6.4h][W15-B1]Yang Yuqing #753

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Yoochard
Copy link

@Yoochard Yoochard commented Mar 4, 2018

Add a Printable interface [LO-Interfaces]

Copy link

@devamanyu devamanyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good PR. Minor comments have been made. Please check them out and close this PR. Overall, the PR has been sent a bit late, please take care of this in future tutorials.

/**
* Returns a String representation of an object
*/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid spaces in between comments and code.

/**
* This is an interface to provide an object's printable representation.
*/
public interface Printable {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job in remembering to write comments for the new interface.

@@ -82,4 +68,12 @@ default String getAsTextHidePrivate() {
}
return builder.toString();
}

default String getPrintableString(Printable... printables) {
StringJoiner sj = new StringJoiner(" ");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

StringBuilder or StringJoiner can both be used. Good that one of the mentioned is used here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants