Skip to content

Commit

Permalink
(#1560) Use Concatendated instead of StringBuilder
Browse files Browse the repository at this point in the history
Co-authored-by: andreoss <[email protected]>
  • Loading branch information
DmitryBarskov and andreoss committed May 5, 2021
1 parent 9a63102 commit 4bf9b9a
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/main/java/org/cactoos/map/MapEnvelope.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.cactoos.iterable.Mapped;
import org.cactoos.text.Concatenated;
import org.cactoos.text.Joined;
import org.cactoos.text.TextOf;

/**
* Map envelope.
Expand Down Expand Up @@ -124,18 +125,14 @@ public final Set<Map.Entry<X, Y>> entrySet() {

@Override
public final String toString() {
return new StringBuilder()
.append('{')
.append(
new Concatenated(
new Joined(
", ",
new Mapped<>(Object::toString, this.entrySet())
)
)
)
.append('}')
.toString();
return new Concatenated(
new TextOf("{"),
new Joined(
", ",
new Mapped<>(Object::toString, this.entrySet())
),
new TextOf("}")
).toString();
}

@Override
Expand Down

0 comments on commit 4bf9b9a

Please sign in to comment.