Skip to content

Commit

Permalink
Generate a more readable toString method
Browse files Browse the repository at this point in the history
Signed-off-by: mbaxter <[email protected]>
  • Loading branch information
mbaxter committed Mar 5, 2024
1 parent 2e34005 commit 9a9cfa2
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

import org.hyperledger.besu.ethereum.core.Block;

import com.google.common.base.MoreObjects;

public class BadBlockCause {
public enum BadBlockReason {
// Standard spec-related validation failures
Expand Down Expand Up @@ -55,6 +57,9 @@ public String getDescription() {

@Override
public String toString() {
return "BadBlockCause{" + "reason=" + reason + ", description='" + description + '\'' + '}';
return MoreObjects.toStringHelper(this)
.add("reason", reason)
.add("description", description)
.toString();
}
}

0 comments on commit 9a9cfa2

Please sign in to comment.