Skip to content

Commit 27207fe

Browse files
andythsuebyhr
authored andcommitted
Replace String concat with toStringHelper() in MVELRoutingRule
1 parent 83b6bd9 commit 27207fe

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

gateway-ha/src/main/java/io/trino/gateway/ha/router/MVELRoutingRule.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import java.util.List;
2424
import java.util.Map;
2525

26+
import static com.google.common.base.MoreObjects.toStringHelper;
2627
import static com.google.common.collect.ImmutableList.toImmutableList;
2728
import static java.util.Objects.requireNonNull;
2829
import static java.util.Objects.requireNonNullElse;
@@ -127,13 +128,13 @@ public void evaluateAction(Map<String, String> result, Map<String, Object> data,
127128
@Override
128129
public String toString()
129130
{
130-
return "MVELRoutingRule{" +
131-
"name='" + name + '\'' +
132-
", description='" + description + '\'' +
133-
", priority=" + priority +
134-
", condition=" + decompile(condition) +
135-
", actions=" + String.join(",", actions.stream().map(DebugTools::decompile).toList()) +
136-
", parserContext=" + parserContext +
137-
'}';
131+
return toStringHelper(this)
132+
.add("name", name)
133+
.add("description", description)
134+
.add("priority", priority)
135+
.add("condition", decompile(condition))
136+
.add("actions", String.join(",", actions.stream().map(DebugTools::decompile).toList()))
137+
.add("parserContext", parserContext)
138+
.toString();
138139
}
139140
}

0 commit comments

Comments
 (0)