Skip to content

Commit

Permalink
优化 MapBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
周旭 committed Oct 24, 2021
1 parent 95d4b52 commit 278b73e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/ejlchina/searcher/util/MapBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ public MapBuilder put(String key, Object value) {
return this;
}

public <T> MapBuilder val(FieldFunction<T, ?> fieldFn, Object... values) {
return val(toFieldName(fieldFn), values);
public <T> MapBuilder field(FieldFunction<T, ?> fieldFn, Object... values) {
return field(toFieldName(fieldFn), values);
}

public <T> MapBuilder val(String fieldName, Object... values) {
public <T> MapBuilder field(String fieldName, Object... values) {
String separator = config(SEPARATOR);
for (int index = 0; index < values.length; index++) {
map.put(fieldName + separator + index, values[index]);
Expand Down

0 comments on commit 278b73e

Please sign in to comment.