Skip to content

Commit

Permalink
Make name getter method in Mapper.Builder final
Browse files Browse the repository at this point in the history
FieldAliasMapper used to override it but it would not change any behaviour, it can rather call
the existing getter for it.
  • Loading branch information
javanna committed Feb 20, 2024
1 parent 5920c91 commit c9c9325
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,10 @@ public boolean supportsVersion(IndexVersion indexCreatedVersion) {
}

public static class Builder extends Mapper.Builder {
private String name;
private String path;

protected Builder(String name) {
super(name);
this.name = name;
}

public String name() {
return this.name;
}

public Builder path(String path) {
Expand All @@ -157,8 +151,8 @@ public Builder path(String path) {

@Override
public FieldAliasMapper build(MapperBuilderContext context) {
String fullName = context.buildFullName(name);
return new FieldAliasMapper(name, fullName, path);
String fullName = context.buildFullName(name());
return new FieldAliasMapper(name(), fullName, path);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected Builder(String name) {
}

// TODO rename this to leafName?
public String name() {
public final String name() {
return this.name;
}

Expand Down

0 comments on commit c9c9325

Please sign in to comment.