From 2ba3d69d6aefd6e0ad5c6d6e3688227536a6531b Mon Sep 17 00:00:00 2001 From: maxim5 Date: Mon, 12 Jul 2021 20:42:27 +0200 Subject: [PATCH] simplify .toString() --- src/io/routekit/ConstToken.java | 2 +- src/io/routekit/SeparableVariableToken.java | 2 +- src/io/routekit/WildcardToken.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/io/routekit/ConstToken.java b/src/io/routekit/ConstToken.java index c93c5f4..e9fc0f0 100644 --- a/src/io/routekit/ConstToken.java +++ b/src/io/routekit/ConstToken.java @@ -28,7 +28,7 @@ public CharBuffer buffer() { @Override public String toString() { - return "ConstToken[" + token + "]"; + return "ConstToken[%s]".formatted(token); } @Override diff --git a/src/io/routekit/SeparableVariableToken.java b/src/io/routekit/SeparableVariableToken.java index 81cae0d..6915bdc 100644 --- a/src/io/routekit/SeparableVariableToken.java +++ b/src/io/routekit/SeparableVariableToken.java @@ -21,6 +21,6 @@ public int match(CharBuffer buffer) { @Override public String toString() { - return "SeparableVariableToken[" + name() + "]"; + return "SeparableVariableToken[%s]".formatted(name()); } } diff --git a/src/io/routekit/WildcardToken.java b/src/io/routekit/WildcardToken.java index e7cd9a2..bd7dc4b 100644 --- a/src/io/routekit/WildcardToken.java +++ b/src/io/routekit/WildcardToken.java @@ -14,6 +14,6 @@ public int match(CharBuffer buffer) { @Override public String toString() { - return "WildcardToken[" + name() + "]"; + return "WildcardToken[%s]".formatted(name()); } }