Skip to content

Commit f3b4730

Browse files
committed
Revert "Delete BasicMessageInterpolator.java"
This reverts commit b54b5f0.
1 parent b54b5f0 commit f3b4730

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package io.avaje.validation.core;
2+
3+
import java.util.Map;
4+
5+
final class BasicMessageInterpolator implements MessageInterpolator {
6+
7+
@Override
8+
public String interpolate(String template, Map<String, Object> attributes) {
9+
10+
String result = template;
11+
12+
for (final Map.Entry<String, Object> entry : attributes.entrySet()) {
13+
// needs work here to improve functionality, support local specific value formatting eg
14+
// Duration Max
15+
result = result.replace('{' + entry.getKey() + '}', String.valueOf(entry.getValue()));
16+
}
17+
// return the message
18+
return result;
19+
}
20+
}

0 commit comments

Comments
 (0)